@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface XMLUtilAccess
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFORMER_SAXON_6
Saxon 6 transformer
|
static int |
TRANSFORMER_SAXON_ENTERPRISE_EDITION
Saxon 9 Enterprise Edition transformer type (full extensions support + schema aware).
|
static int |
TRANSFORMER_SAXON_HOME_EDITION
Saxon 9 Home Edition transformer type (no extensions support).
|
static int |
TRANSFORMER_SAXON_PROFESSIONAL_EDITION
Saxon 9 Professional Edition transformer type (full extensions support).
|
static int |
TRANSFORMER_XALAN
Xalan transformer
|
Modifier and Type | Method and Description |
---|---|
void |
addPriorityEntityResolver(org.xml.sax.EntityResolver entityResolver)
Add a priority entity resolver.
|
void |
addPriorityURIResolver(javax.xml.transform.URIResolver uriResolver)
Add a priority URI resolver.
|
javax.xml.transform.Transformer |
createSaxon9HEXSLTTransformerWithExtensions(javax.xml.transform.Source styleSource,
net.sf.saxon.lib.ExtensionFunctionDefinition[] saxonExtensions)
Create a Saxon 9 Home Edition transformer with the specified extension functions.
|
javax.xml.transform.Transformer |
createXQueryTransformer(javax.xml.transform.Source xquerySource,
java.net.URL[] extensionJars,
int transformerType)
Create a new XQuery transformer.
|
javax.xml.transform.Transformer |
createXQueryTransformer(javax.xml.transform.Source xquerySource,
java.net.URL[] extensionJars,
int transformerType,
boolean useOxygenOptions)
Create a new XQuery transformer.
|
javax.xml.transform.Transformer |
createXQueryUpdateTransformer(javax.xml.transform.Source xquerySource,
java.net.URL[] extensionJars)
Create a new transformer capable of executing XQuery Update.
|
javax.xml.transform.Transformer |
createXSLTTransformer(javax.xml.transform.Source styleSource,
java.net.URL[] extensionJars,
int transformerType)
Create a new XSLT transformer.
|
javax.xml.transform.Transformer |
createXSLTTransformer(javax.xml.transform.Source styleSource,
java.net.URL[] extensionJars,
int transformerType,
boolean useOxygenOptions)
Create a new XSLT transformer.
|
java.lang.String |
escapeAttributeValue(java.lang.String attributeValue)
Escape an attribute value so that the XML document remains well-formed.
|
java.lang.String |
escapeTextValue(java.lang.String textValue)
Escape text which will be inserted in the XML so that the XML document remains well-formed.
|
org.xml.sax.EntityResolver |
getEntityResolver()
Get the same entity resolver Oxygen sets to its constructed SAX Parsers
(which looks into the Oxygen options and document types for catalogs).
|
javax.xml.transform.URIResolver |
getURIResolver()
Get the same URI resolver Oxygen sets to its constructed XSLT transformers
(which looks into the Oxygen options and document types for catalogs).
|
org.xml.sax.XMLReader |
newNonValidatingXMLReader()
Creates an
XMLReader without validation. |
XMLReaderWithGrammar |
newNonValidatingXMLReader(java.lang.Object grammarCacheToken)
Creates an
XMLReader without validation and with the possibility to reuse the grammar pool. |
java.lang.String |
prettyPrint(java.io.Reader reader,
java.lang.String systemID)
Pretty prints the given XML document.
|
void |
removePriorityEntityResolver(org.xml.sax.EntityResolver entityResolver)
Remove a priority entity resolver.
|
void |
removePriorityURIResolver(javax.xml.transform.URIResolver uriResolver)
Remove a priority URI resolver.
|
void |
resetXMLCatalogs()
Reset the loaded XML catalogs.
|
java.net.URL |
resolvePathThroughCatalogs(java.net.URL baseURL,
java.lang.String relativeLocation,
boolean entityResolve,
boolean uriResolve)
Try to resolve a relative location to an absolute path by using the XML catalogs.
|
MergeResult |
threeWayAutoMerge(java.lang.String ancestor,
java.lang.String left,
java.lang.String right,
MergeConflictResolutionMethods conflictResolutionMethod)
Merges two strings representing XML files using a three way merging algorithm which needs an ancestor file.
|
java.lang.String |
unescapeAttributeValue(java.lang.String attributeValue)
Unescape an attribute value.
|
static final int TRANSFORMER_XALAN
static final int TRANSFORMER_SAXON_6
static final int TRANSFORMER_SAXON_HOME_EDITION
static final int TRANSFORMER_SAXON_PROFESSIONAL_EDITION
static final int TRANSFORMER_SAXON_ENTERPRISE_EDITION
javax.xml.transform.Transformer createXSLTTransformer(javax.xml.transform.Source styleSource, java.net.URL[] extensionJars, int transformerType) throws javax.xml.transform.TransformerConfigurationException
styleSource
- The source XSLextensionJars
- Jars with extension libraries which can be used by the transformer, can be null
transformerType
- The type of the transformer to create, one of the constants defined in this class starting with TRANSFORMER_javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error occurs during parsing of the
source
.javax.xml.transform.Transformer createXSLTTransformer(javax.xml.transform.Source styleSource, java.net.URL[] extensionJars, int transformerType, boolean useOxygenOptions) throws javax.xml.transform.TransformerConfigurationException
styleSource
- The source XSLextensionJars
- Jars with extension libraries which can be used by the transformer. Can be null
.transformerType
- The type of the transformer to create, one of the constants defined in this class starting with TRANSFORMER_useOxygenOptions
- If true
the options set in the oXygen preferences are used. Otherwise no options are set to the transformers.javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error
occurs during parsing of the source
.javax.xml.transform.Transformer createSaxon9HEXSLTTransformerWithExtensions(javax.xml.transform.Source styleSource, net.sf.saxon.lib.ExtensionFunctionDefinition[] saxonExtensions) throws javax.xml.transform.TransformerConfigurationException
Create a Saxon 9 Home Edition transformer with the specified extension functions. This is necessary when the extension functions cannot be called by reflection because there is no license for the commercial version of Saxon 9.
The Saxon 9 options set in the oXygen preferences are not used.
styleSource
- The source XSLsaxonExtensions
- The list of Saxon 9 extensions.javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error
occurs during parsing of the source
.javax.xml.transform.Transformer createXQueryTransformer(javax.xml.transform.Source xquerySource, java.net.URL[] extensionJars, int transformerType) throws javax.xml.transform.TransformerConfigurationException
xquerySource
- The source XQuery fileextensionJars
- Jars with extension libraries which can be used by the transformer, can be null
transformerType
- The type of the transformer to create, one of the constants:
javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error
occurs during parsing of the source
.javax.xml.transform.Transformer createXQueryTransformer(javax.xml.transform.Source xquerySource, java.net.URL[] extensionJars, int transformerType, boolean useOxygenOptions) throws javax.xml.transform.TransformerConfigurationException
xquerySource
- The source XQuery fileextensionJars
- Jars with extension libraries which can be used by the transformer.
Can be null
.transformerType
- The type of the transformer to create, one of the constants:
useOxygenOptions
- If true
the options set in the oXygen preferences are used.
Otherwise no options are set to the transformers.javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error
occurs during parsing of the source
.javax.xml.transform.Transformer createXQueryUpdateTransformer(javax.xml.transform.Source xquerySource, java.net.URL[] extensionJars) throws javax.xml.transform.TransformerConfigurationException
xquerySource
- The source XQuery fileextensionJars
- Jars with extension libraries which can be used by the transformer.
Can be null
.javax.xml.transform.TransformerConfigurationException
- An Exception
is thrown if an error
occurs during parsing of the source
.void resetXMLCatalogs()
java.net.URL resolvePathThroughCatalogs(java.net.URL baseURL, java.lang.String relativeLocation, boolean entityResolve, boolean uriResolve)
baseURL
- The URL of the current opened XML file.relativeLocation
- The relative location to be resolved.entityResolve
- true
if the catalog entity resolver should be used.uriResolve
- true
if the catalog URI resolver should be used.java.lang.String escapeAttributeValue(java.lang.String attributeValue)
attributeValue
- The attribute value.null
.java.lang.String escapeTextValue(java.lang.String textValue)
textValue
- The text value.null
.java.lang.String unescapeAttributeValue(java.lang.String attributeValue) throws java.lang.IllegalArgumentException
attributeValue
- The attribute value to be unescaped.null
.java.lang.IllegalArgumentException
- when having problems with unescaping hex or decimal characters from the method's argument.java.lang.String prettyPrint(java.io.Reader reader, java.lang.String systemID) throws PrettyPrintException
reader
- The reader with over the document that is to be pretty printed.systemID
- The URL location where the current XML fragment to format and indent is located.
This parameter is not required but it may be used to solves relative entities from the DOCTYPE declaration in the XML content.PrettyPrintException
- If the pretty printing failed.org.xml.sax.XMLReader newNonValidatingXMLReader()
XMLReader
without validation.XMLReaderWithGrammar newNonValidatingXMLReader(java.lang.Object grammarCacheToken)
XMLReader
without validation and with the possibility to reuse the grammar pool.
If you are parsing XML fragments with DOCTYPE many times in your operation this method will be faster than
the newNonValidatingXMLReader()
method.
String xml = new String("<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">\n" +
"<map/>");
Object grammarToken = null;
for (int i = 0; i < 100000; i++) {
XMLReaderWithGrammar readerAndCache = authorAccess.getXMLUtilAccess().newNonValidatingXMLReader(grammarToken);
XMLReader reader = readerAndCache.getXmlReader();
grammarToken = readerAndCache.getGrammarCache();
reader.parse(new InputSource(new StringReader(xml)));
}
grammarCacheToken
- The grammar cache token, if not null, it will be used to cache the grammar pool.org.xml.sax.EntityResolver getEntityResolver()
javax.xml.transform.URIResolver getURIResolver()
void addPriorityEntityResolver(org.xml.sax.EntityResolver entityResolver)
entityResolver
- The entity resolver which will be called with priority before Oxygen calls the standard resolvers which are
based on the catalog files specified in the preferences catalogs list and in each document type association.void removePriorityEntityResolver(org.xml.sax.EntityResolver entityResolver)
entityResolver
- The entity resolver which will be called with priority before Oxygen calls the standard resolvers which are
based on the catalog files specified in the preferences catalogs list and in each document type association.void addPriorityURIResolver(javax.xml.transform.URIResolver uriResolver)
uriResolver
- The URI resolver which will be called with priority before Oxygen calls the standard resolvers which are
based on the catalog files specified in the preferences catalogs list and in each document type association.void removePriorityURIResolver(javax.xml.transform.URIResolver uriResolver)
uriResolver
- The URI resolver which will be called with priority before Oxygen calls the standard resolvers which are
based on the catalog files specified in the preferences catalogs list and in each document type association.MergeResult threeWayAutoMerge(java.lang.String ancestor, java.lang.String left, java.lang.String right, MergeConflictResolutionMethods conflictResolutionMethod)
ancestor
- The original file string which has been modified into left and right.left
- The left version of the file string, the one with "our" changes.right
- The right version of the file string, the one with "others" changes.conflictResolutionMethod
- The conflict resolution method to use.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.