org.apache.xmlbeans

## Class XmlOptions

- java.lang.Object
- - org.apache.xmlbeans.XmlOptions

All Implemented Interfaces:
  Serializable

    public class XmlOptions
    extends Object
    implements Serializable

Used to supply options for loading, saving, and compiling, and validating.

There are two styles for using XmlOptions: multiline setup, and single-line use. Here are two examples. First, multiline style:

     XmlOptions opts = new XmlOptions();
     opts.setSavePrettyPrint();
     opts.setSavePrettyPrintIndent(4);
     System.out.println(xobj.xmlText(opts));

The alternative is single-line usage:

     System.out.println(xobj.xmlText(
         new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(4)));

Table showing where each option gets used. Note that:

- options available for `newInstance` methods will also apply for `parse` methods
- options used for `validate` methods are also used for `compile` methods, since compilation usually implies validation against Schema for Schemas

Option matrix
`newInstance` methods | `parse` methods | `validate` methods | `compile` methods | `save` and `xmlText`methods
--- | --- | --- | --- | ---
`setDocumentType` `setDocumentSourceName` `setValidateOnSet` `setUnsynchronized` | `setLoad***` `setEntityResolver` | `setErrorListener` `setValidateTreatLaxAsSkip` `setValidateStrict` | `setErrorListener` `setCompile***` `setEntityResolver` `setBaseURI` `setGenerateJavaVersion` | `setSave***` `setUseDefaultNamespace` `setCharacterEncoding`

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `XmlOptions.BeanMethod`
`static class` `XmlOptions.XmlOptionsKeys`

### Field Summary

Fields
`static int` `DEFAULT_ENTITY_EXPANSION_LIMIT`

### Constructor Summary

Constructors
Constructor and Description
`XmlOptions()` Construct a new blank XmlOptions.
`XmlOptions(XmlOptions other)` Construct a new XmlOptions, copying the options.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `disallowDocTypeDeclaration()` Returns whether DocType declarations are disallowed during XML parsing.
`Object` `get(XmlOptions.XmlOptionsKeys option)` Used to get a generic option
`URI` `getBaseURI()`
`String` `getCharacterEncoding()`
`Set<String>` `getCompileMdefNamespaces()`
`Set<XmlOptions.BeanMethod>` `getCompilePartialMethod()`
`Map<QName,QName>` `getCompileSubstituteNames()`
`String` `getDocumentSourceName()`
`SchemaType` `getDocumentType()`
`int` `getEntityExpansionLimit()`
`EntityResolver` `getEntityResolver()`
`Collection<XmlError>` `getErrorListener()`
`Map<String,String>` `getLoadAdditionalNamespaces()`
`Integer` `getLoadEntityBytesLimit()`
`QName` `getLoadReplaceDocumentElement()`
`Map<String,String>` `getLoadSubstituteNamespaces()`
`XMLReader` `getLoadUseXMLReader()`
`Saaj` `getSaaj()`
`Integer` `getSaveCDataEntityCountThreshold()`
`Integer` `getSaveCDataLengthThreshold()`
`String` `getSaveFilterProcinst()`
`Map<String,String>` `getSaveImplicitNamespaces()`
`Integer` `getSavePrettyPrintIndent()`
`Integer` `getSavePrettyPrintOffset()`
`XmlOptionCharEscapeMap` `getSaveSubstituteCharacters()`
`Map<String,String>` `getSaveSuggestedPrefixes()`
`QName` `getSaveSyntheticDocumentElement()`
`SchemaCodePrinter` `getSchemaCodePrinter()`
`Object` `getUseSameLocale()`
`String` `getXqueryCurrentNodeVar()`
`Map<String,Object>` `getXqueryVariables()`
`boolean` `hasOption(XmlOptions.XmlOptionsKeys option)` Used to test a generic option
`boolean` `isAttributeValidationCompatMode()`
`boolean` `isCompileAnnotationAsJavadoc()`
`boolean` `isCompileDownloadUrls()`
`boolean` `isCompileNoAnnotations()`
`boolean` `isCompileNoPvrRule()`
`boolean` `isCompileNoUpaRule()`
`boolean` `isCompileNoValidation()`
`boolean` `isCompilePartialTypesystem()`
`boolean` `isCopyUseNewSynchronizationDomain()`
`boolean` `isLoadDTDGrammar()` Returns whether DTD grammar is loaded during parsing.
`boolean` `isLoadExternalDTD()` Returns whether external DTDs are loaded during parsing.
`boolean` `isLoadLineNumbers()`
`boolean` `isLoadLineNumbersEndElement()`
`boolean` `isLoadMessageDigest()`
`boolean` `isLoadStripComments()`
`boolean` `isLoadStripProcinsts()`
`boolean` `isLoadTrimTextBuffer()`
`boolean` `isLoadUseDefaultResolver()`
`boolean` `isLoadUseLocaleCharUtil()`
`boolean` `isSaveAggressiveNamespaces()`
`boolean` `isSaveInner()`
`boolean` `isSaveNamespacesFirst()`
`boolean` `isSaveNoXmlDecl()`
`boolean` `isSaveOptimizeForSpeed()`
`boolean` `isSaveOuter()`
`boolean` `isSavePrettyPrint()`
`boolean` `isSaveSaxNoNSDeclsInAttributes()`
`boolean` `isSaveUseOpenFrag()`
`boolean` `isSetLoadStripWhitespace()`
`boolean` `isUnsynchronized()`
`boolean` `isUseCDataBookmarks()`
`boolean` `isUseDefaultNamespace()`
`boolean` `isValidateOnSet()`
`boolean` `isValidateStrict()`
`boolean` `isValidateTextOnly()`
`boolean` `isValidateTreatLaxAsSkip()`
`boolean` `isXPathUseSaxon()`
`boolean` `isXPathUseXmlBeans()`
`static XmlOptions` `maskNull(XmlOptions o)` If passed null, returns an empty options object.
`void` `remove(XmlOptions.XmlOptionsKeys option)`
`XmlOptions` `setAttributeValidationCompatMode(boolean attributeValidationCompatMode)`
`XmlOptions` `setBaseURI(URI baseURI)` If this option is set when compiling a schema, then the given URI will be considered as base URI when deciding the directory structure for saving the sources inside the generated JAR file.
`XmlOptions` `setCharacterEncoding(String encoding)` When writing a document, this sets the character encoding to use.
`XmlOptions` `setCompileAnnotationAsJavadoc()`
`XmlOptions` `setCompileAnnotationAsJavadoc(boolean useAnnotationAsJavadoc)` When generating the schema sources, copy over the schema annotations to the javadoc.
`XmlOptions` `setCompileDownloadUrls()` If this option is set, then the schema compiler will try to download schemas that appear in imports and includes from network based URLs.
`XmlOptions` `setCompileDownloadUrls(boolean b)`
`XmlOptions` `setCompileMdefNamespaces(Set<String> mdefNamespaces)` If this option is set, then the schema compiler will permit and ignore multiple definitions of the same component (element, attribute, type, etc) names in the given namespaces.
`XmlOptions` `setCompileNoAnnotations()` if this option is set, the schema compiler will skip annotations when processing Schema components.
`XmlOptions` `setCompileNoAnnotations(boolean b)`
`XmlOptions` `setCompileNoPvrRule()` If this option is set, the particle valid (restriciton) rule is not enforced when building a `SchemaTypeSystem`.
`XmlOptions` `setCompileNoPvrRule(boolean b)`
`XmlOptions` `setCompileNoUpaRule()` If this option is set, the unique particle attribution rule is not enforced when building a `SchemaTypeSystem`.
`XmlOptions` `setCompileNoUpaRule(boolean b)`
`XmlOptions` `setCompileNoValidation()` If this option is set, validation is not done on the Schema XmlBeans when building a `SchemaTypeSystem`
`void` `setCompilePartialMethod(Set<XmlOptions.BeanMethod> list)`
`XmlOptions` `setCompilePartialTypesystem()`
`XmlOptions` `setCompilePartialTypesystem(boolean compilePartialTypesystem)`
`XmlOptions` `setCompileSubstituteNames(Map<QName,QName> nameMap)` This option allows for `QName` substitution during schema compilation.
`XmlOptions` `setCopyUseNewSynchronizationDomain(boolean useNewSyncDomain)` If this option is set to true, the return of XmlObject.copy() method will return an object in it's own synchronization domain, otherwise both objects will share the same synchronization domain, requiring explicit synchronization when concurent accessing the two objects.
`XmlOptions` `setDisallowDocTypeDeclaration(boolean disallowDocTypeDeclaration)` Controls whether DocType declarations are disallowed during XML parsing.
`XmlOptions` `setDocumentSourceName(String documentSourceName)` This option sets the document source name into the xml store when parsing a document.
`XmlOptions` `setDocumentType(SchemaType type)` When parsing a document, this sets the type of the root element.
`XmlOptions` `setEntityExpansionLimit(int entityExpansionLimit)` Sets the maximum number of entity expansions allowed during parsing.
`XmlOptions` `setEntityResolver(EntityResolver resolver)` If this option is set when compiling a schema, then the given EntityResolver will be consulted in order to resolve any URIs while downloading imported schemas.
`XmlOptions` `setErrorListener(Collection<XmlError> c)` Sets a collection object for collecting `XmlError` objects during parsing, validation, and compilation.
`XmlOptions` `setLoadAdditionalNamespaces(Map<String,String> nses)` Set additional namespace mappings to be added when parsing a document.
`XmlOptions` `setLoadDTDGrammar(boolean loadDTDGrammar)` Controls whether DTD grammar is loaded during parsing.
`XmlOptions` `setLoadEntityBytesLimit(int entityBytesLimit)` Sets the maximum number of bytes allowed when an Entity is expanded during parsing.
`XmlOptions` `setLoadExternalDTD(boolean loadExternalDTD)` Controls whether external DTDs are loaded during parsing.
`XmlOptions` `setLoadLineNumbers()` If this option is set, line number annotations are placed in the store when parsing a document.
`XmlOptions` `setLoadLineNumbers(boolean b)`
`XmlOptions` `setLoadLineNumbersEndElement()` If this option is set, line number annotations are placed in the store when parsing a document.
`XmlOptions` `setLoadLineNumbersEndElement(boolean b)`
`XmlOptions` `setLoadMessageDigest()` If this option is set when loading from an InputStream or File, then the loader will compute a 160-bit SHA-1 message digest of the XML file while loading it and make it available via XmlObject.documentProperties().getMessageDigest(); The schema compiler uses message digests to detect and eliminate duplicate imported xsd files.
`XmlOptions` `setLoadMessageDigest(boolean b)`
`XmlOptions` `setLoadReplaceDocumentElement(QName replacement)` If this option is set, the document element is replaced with the given QName when parsing.
`XmlOptions` `setLoadStripComments()` If this option is set, all comments are stripped when parsing a document.
`XmlOptions` `setLoadStripComments(boolean b)`
`XmlOptions` `setLoadStripProcinsts()` If this option is set, all processing instructions are stripped when parsing a document.
`XmlOptions` `setLoadStripProcinsts(boolean b)`
`XmlOptions` `setLoadStripWhitespace()` If this option is set, all insignificant whitespace is stripped when parsing a document.
`XmlOptions` `setLoadStripWhitespace(boolean b)`
`XmlOptions` `setLoadSubstituteNamespaces(Map<String,String> substNamespaces)` This option sets a map of namespace uri substitutions that happen when parsing a document.
`XmlOptions` `setLoadTrimTextBuffer()` If this option is set, the underlying xml text buffer is trimmed immediately after parsing a document resulting in a smaller memory footprint.
`XmlOptions` `setLoadTrimTextBuffer(boolean b)`
`XmlOptions` `setLoadUseDefaultResolver()` By default, XmlBeans does not resolve entities when parsing xml documents (unless an explicit entity resolver is specified).
`XmlOptions` `setLoadUseDefaultResolver(boolean b)`
`XmlOptions` `setLoadUseLocaleCharUtil(boolean useCharUtil)`
`XmlOptions` `setLoadUseXMLReader(XMLReader xmlReader)` By default, XmlBeans creates a JAXP parser, other parsers can be used by providing an XMLReader.
`XmlOptions` `setSaaj(Saaj saaj)`
`XmlOptions` `setSaveAggressiveNamespaces()` Causes the saver to reduce the number of namespace prefix declarations.
`XmlOptions` `setSaveAggressiveNamespaces(boolean b)`
`XmlOptions` `setSaveCDataEntityCountThreshold(int cdataEntityCountThreshold)` This option controls when saving will use CDATA blocks.
`XmlOptions` `setSaveCDataLengthThreshold(int cdataLengthThreshold)` This option controls when saving will use CDATA blocks.
`XmlOptions` `setSaveFilterProcinst(String filterProcinst)` This option causes the saver to filter a Processing Instruction with the given target
`XmlOptions` `setSaveImplicitNamespaces(Map<String,String> implicitNamespaces)` If namespaces have already been declared outside the scope of the fragment being saved, this allows those mappings to be passed down to the saver, so the prefixes are not re-declared.
`XmlOptions` `setSaveInner()` This option controls whether saving begins on the element or its contents
`XmlOptions` `setSaveInner(boolean b)`
`XmlOptions` `setSaveNamespacesFirst()` This option will cause the saver to save namespace attributes first.
`XmlOptions` `setSaveNamespacesFirst(boolean b)`
`XmlOptions` `setSaveNoXmlDecl()` This option controls whether saving saves out the XML declaration {@code
`XmlOptions` `setSaveNoXmlDecl(boolean b)`
`XmlOptions` `setSaveOptimizeForSpeed(boolean saveOptimizeForSpeed)`
`XmlOptions` `setSaveOuter()` This option controls whether saving begins on the element or its contents
`XmlOptions` `setSaveOuter(boolean b)`
`XmlOptions` `setSavePrettyPrint()` This option will cause the saver to reformat white space for easier reading.
`XmlOptions` `setSavePrettyPrint(boolean b)`
`XmlOptions` `setSavePrettyPrintIndent(int indent)` When used with `setSavePrettyPrint` this sets the indent amount to use.
`XmlOptions` `setSavePrettyPrintOffset(int offset)` When used with `setSavePrettyPrint` this sets the offset amount to use.
`XmlOptions` `setSaveSaxNoNSDeclsInAttributes()` This option controls whether namespace declarations are included as attributes in the startElement event.
`XmlOptions` `setSaveSaxNoNSDeclsInAttributes(boolean b)`
`XmlOptions` `setSaveSubstituteCharacters(XmlOptionCharEscapeMap characterReplacementMap)` This option causes the saver to replace characters with other values in the output stream.
`XmlOptions` `setSaveSuggestedPrefixes(Map<String,String> suggestedPrefixes)` A map of hints to pass to the saver for which prefixes to use for which namespace URI.
`XmlOptions` `setSaveSyntheticDocumentElement(QName name)` This option causes the saver to wrap the current fragment in an element with the given name.
`XmlOptions` `setSaveUseOpenFrag()` When saving a fragment, this option changes the qname of the synthesized root element.
`XmlOptions` `setSaveUseOpenFrag(boolean b)`
`XmlOptions` `setSchemaCodePrinter(SchemaCodePrinter printer)` If this option is set when compiling a schema, then the given SchemaTypeCodePrinter.Printer will be used to generate the Java code.
`XmlOptions` `setUnsynchronized()` This option controls whether or not operations on XmlBeans are thread safe.
`XmlOptions` `setUnsynchronized(boolean b)`
`XmlOptions` `setUseCDataBookmarks()` Use this option when parsing and saving XML documents.
`XmlOptions` `setUseDefaultNamespace()` If this option is set, the saver will try to use the default namespace for the most commonly used URI.
`XmlOptions` `setUseDefaultNamespace(boolean b)`
`XmlOptions` `setUseSameLocale(Object localeOrXmlTokenSource)`
`XmlOptions` `setValidateOnSet()` If this option is set when an instance is created, then value facets will be checked on each call to a setter or getter method on instances of XmlObject within the instance document.
`XmlOptions` `setValidateOnSet(boolean b)`
`XmlOptions` `setValidateStrict()` Performs additional validation checks that are disabled by default for better compatibility.
`XmlOptions` `setValidateStrict(boolean b)`
`XmlOptions` `setValidateTextOnly()`
`XmlOptions` `setValidateTextOnly(boolean b)`
`XmlOptions` `setValidateTreatLaxAsSkip()` Instructs the validator to skip elements matching an `<any>` particle with contentModel="lax".
`XmlOptions` `setValidateTreatLaxAsSkip(boolean b)`
`XmlOptions` `setXPathUseSaxon()`
`XmlOptions` `setXPathUseSaxon(boolean xpathUseSaxon)`
`XmlOptions` `setXPathUseXmlBeans()`
`XmlOptions` `setXPathUseXmlBeans(boolean xpathUseXmlBeans)`
`XmlOptions` `setXqueryCurrentNodeVar(String varName)` Sets the name of the variable that represents the current node in a query expression.
`XmlOptions` `setXqueryVariables(Map<String,Object> varMap)` Map the names and values of external variables in an xquery expression.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_ENTITY_EXPANSION_LIMIT

    public static final int DEFAULT_ENTITY_EXPANSION_LIMIT

See Also:
  Constant Field Values

### Constructor Detail

#### XmlOptions

    public XmlOptions()

Construct a new blank XmlOptions.

#### XmlOptions

    public XmlOptions(XmlOptions other)

Construct a new XmlOptions, copying the options.

### Method Detail

#### setSaveNamespacesFirst

    public XmlOptions setSaveNamespacesFirst()

This option will cause the saver to save namespace attributes first.

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveNamespacesFirst

    public XmlOptions setSaveNamespacesFirst(boolean b)

#### isSaveNamespacesFirst

    public boolean isSaveNamespacesFirst()

#### setSavePrettyPrint

    public XmlOptions setSavePrettyPrint()

This option will cause the saver to reformat white space for easier reading.

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSavePrettyPrint

    public XmlOptions setSavePrettyPrint(boolean b)

#### isSavePrettyPrint

    public boolean isSavePrettyPrint()

#### setSavePrettyPrintIndent

    public XmlOptions setSavePrettyPrintIndent(int indent)

When used with `setSavePrettyPrint` this sets the indent amount to use.

Parameters:
  `indent` - the indent amount to use
See Also:
  `setSavePrettyPrint()`, `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSavePrettyPrintIndent

    public Integer getSavePrettyPrintIndent()

#### setSavePrettyPrintOffset

    public XmlOptions setSavePrettyPrintOffset(int offset)

When used with `setSavePrettyPrint` this sets the offset amount to use.

Parameters:
  `offset` - the offset amount to use
See Also:
  `setSavePrettyPrint()`, `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSavePrettyPrintOffset

    public Integer getSavePrettyPrintOffset()

#### setCharacterEncoding

    public XmlOptions setCharacterEncoding(String encoding)

When writing a document, this sets the character encoding to use.

Parameters:
  `encoding` - the character encoding
See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`, `XmlTokenSource.save(java.io.File, XmlOptions)`

#### getCharacterEncoding

    public String getCharacterEncoding()

#### setDocumentType

    public XmlOptions setDocumentType(SchemaType type)

When parsing a document, this sets the type of the root element. If this is set, the parser will not try to guess the type based on the document's `QName`.

Parameters:
  `type` - The root element's document type.
See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### getDocumentType

    public SchemaType getDocumentType()

#### setErrorListener

    public XmlOptions setErrorListener(Collection<XmlError> c)

Sets a collection object for collecting `XmlError` objects during parsing, validation, and compilation. When set, the collection will contain all the errors after the operation takes place. Notice that the errors will only have line numbers if the document was loaded with line numbers enabled.

The following simple example illustrates using an error listener during validation.

     // Create an XmlOptions instance and set the error listener.
     XmlOptions validateOptions = new XmlOptions();
     ArrayList<XmlError> errorList = new ArrayList<>();
     validateOptions.setErrorListener(errorList);

     // Validate the XML.
     boolean isValid = newEmp.validate(validateOptions);

     // If the XML isn't valid, loop through the listener's contents,
     // printing contained messages.
     if (!isValid)
     {
          for (int i = 0; i < errorList.size(); i++)
          {
              XmlError error = (XmlError)errorList.get(i);

              System.out.println("\n");
              System.out.println("Message: " + error.getMessage() + "\n");
              System.out.println("Location of invalid XML: " +
                  error.getCursorLocation().xmlText() + "\n");
          }
     }

Parameters:
  `c` - A collection that will be filled with `XmlError` objects via `Collection.add(E)`
See Also:
  `XmlError`, `XmlObjectFactory.parse(java.io.File, XmlOptions)`, `XmlObject.validate(XmlOptions)`, `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`, `setLoadLineNumbers()`

#### getErrorListener

    public Collection<XmlError> getErrorListener()

#### setSaveAggressiveNamespaces

    public XmlOptions setSaveAggressiveNamespaces()

Causes the saver to reduce the number of namespace prefix declarations. The saver will do this by passing over the document twice, first to collect the set of needed namespace declarations, and then second to actually save the document with the declarations collected at the root.

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveAggressiveNamespaces

    public XmlOptions setSaveAggressiveNamespaces(boolean b)

#### isSaveAggressiveNamespaces

    public boolean isSaveAggressiveNamespaces()

#### setSaveSyntheticDocumentElement

    public XmlOptions setSaveSyntheticDocumentElement(QName name)

This option causes the saver to wrap the current fragment in an element with the given name.

Parameters:
  `name` - the name to use for the top level element
See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSaveSyntheticDocumentElement

    public QName getSaveSyntheticDocumentElement()

#### setUseDefaultNamespace

    public XmlOptions setUseDefaultNamespace()

If this option is set, the saver will try to use the default namespace for the most commonly used URI. If it is not set the saver will always created named prefixes.

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setUseDefaultNamespace

    public XmlOptions setUseDefaultNamespace(boolean b)

#### isUseDefaultNamespace

    public boolean isUseDefaultNamespace()

#### setSaveImplicitNamespaces

    public XmlOptions setSaveImplicitNamespaces(Map<String,String> implicitNamespaces)

If namespaces have already been declared outside the scope of the fragment being saved, this allows those mappings to be passed down to the saver, so the prefixes are not re-declared.

Parameters:
  `implicitNamespaces` - a map of prefixes to uris that can be used by the saver without being declared
See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSaveImplicitNamespaces

    public Map<String,String> getSaveImplicitNamespaces()

#### setSaveSuggestedPrefixes

    public XmlOptions setSaveSuggestedPrefixes(Map<String,String> suggestedPrefixes)

A map of hints to pass to the saver for which prefixes to use for which namespace URI.

Parameters:
  `suggestedPrefixes` - a map from URIs to prefixes
See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSaveSuggestedPrefixes

    public Map<String,String> getSaveSuggestedPrefixes()

#### setSaveFilterProcinst

    public XmlOptions setSaveFilterProcinst(String filterProcinst)

This option causes the saver to filter a Processing Instruction with the given target

Parameters:
  `filterProcinst` - the name of a Processing Instruction to filter on save
See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### getSaveFilterProcinst

    public String getSaveFilterProcinst()

#### setSaveSubstituteCharacters

    public XmlOptions setSaveSubstituteCharacters(XmlOptionCharEscapeMap characterReplacementMap)

This option causes the saver to replace characters with other values in the output stream. It is intended to be used for escaping non-standard characters during output.

Parameters:
  `characterReplacementMap` - is an XmlOptionCharEscapeMap containing the characters to be escaped.
See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`, `XmlOptionCharEscapeMap`

#### getSaveSubstituteCharacters

    public XmlOptionCharEscapeMap getSaveSubstituteCharacters()

#### setSaveUseOpenFrag

    public XmlOptions setSaveUseOpenFrag()

When saving a fragment, this option changes the qname of the synthesized root element. Normally <xml-fragment> is used.

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveUseOpenFrag

    public XmlOptions setSaveUseOpenFrag(boolean b)

#### isSaveUseOpenFrag

    public boolean isSaveUseOpenFrag()

#### setSaveOuter

    public XmlOptions setSaveOuter()

This option controls whether saving begins on the element or its contents

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveOuter

    public XmlOptions setSaveOuter(boolean b)

#### isSaveOuter

    public boolean isSaveOuter()

#### setSaveInner

    public XmlOptions setSaveInner()

This option controls whether saving begins on the element or its contents

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveInner

    public XmlOptions setSaveInner(boolean b)

#### isSaveInner

    public boolean isSaveInner()

#### setSaveNoXmlDecl

    public XmlOptions setSaveNoXmlDecl()

This option controls whether saving saves out the XML declaration `<?xml ... ?>`

See Also:
  `XmlTokenSource.save(java.io.File, XmlOptions)`, `XmlTokenSource.xmlText(XmlOptions)`

#### setSaveNoXmlDecl

    public XmlOptions setSaveNoXmlDecl(boolean b)

#### isSaveNoXmlDecl

    public boolean isSaveNoXmlDecl()

#### setSaveCDataLengthThreshold

    public XmlOptions setSaveCDataLengthThreshold(int cdataLengthThreshold)

This option controls when saving will use CDATA blocks. CDATA will be used if the folowing condition is true:
`textLength > cdataLengthThreshold && entityCount > cdataEntityCountThreshold`
The default value of cdataLengthThreshold is 32.
Use the folowing values for these cases:

Option matrix
Scenario | cdataLengthThreshold | cdataEntityCountThreshold
--- | --- | ---
Every text is CDATA | 0 | -1
Only text that has an entity is CDATA | 0 | 0
Only text longer than x chars is CDATA | x | -1
Only text that has y entitazable chars is CDATA | 0 | y
Only text longer than x chars and has y entitazable chars is CDATA | x | y

See Also:
  `setSaveCDataEntityCountThreshold(int)`

#### getSaveCDataLengthThreshold

    public Integer getSaveCDataLengthThreshold()

#### setSaveCDataEntityCountThreshold

    public XmlOptions setSaveCDataEntityCountThreshold(int cdataEntityCountThreshold)

This option controls when saving will use CDATA blocks. CDATA will be used if the folowing condition is true:
`textLength > cdataLengthThreshold && entityCount > cdataEntityCountThreshold`
The default value of cdataEntityCountThreshold is 5.

See Also:
  `setSaveCDataLengthThreshold(int)`

#### getSaveCDataEntityCountThreshold

    public Integer getSaveCDataEntityCountThreshold()

#### setUseCDataBookmarks

    public XmlOptions setUseCDataBookmarks()

Use this option when parsing and saving XML documents.

For parsing this option will annotate the text fields in the store with CDataBookmark.

For saving this option will save the text fields annotated with CDataBookmark as CDATA XML text.
Note: The SaveCDataEntityCountThreshold and SaveCDataLengthThreshold options and their default values still apply.

Note: Due to the store representation, a CDATA will not be recognized if it is imediately after non CDATA text and all text following it will be considered CDATA.
Example:

     <a><![CDATA[cdata text]]></a>               - is considered as: <a><![CDATA[cdata text]]></a>
     <b><![CDATA[cdata text]]> regular text</b>  - is considered as: <b><![CDATA[cdata text regular text]]></b>
     <c>text <![CDATA[cdata text]]></c>          - is considered as: <c>text cdata text</c>

Sample code:

     String xmlText = "<a>\n" +
     "<a><![CDATA[cdata text]]></a>\n" +
     "<b><![CDATA[cdata text]]> regular text</b>\n" +
     "<c>text <![CDATA[cdata text]]></c>\n" +
     "</a>";
     System.out.println(xmlText);

     XmlOptions opts = new XmlOptions();
     opts.setUseCDataBookmarks();

     XmlObject xo = org.apache.xmlbeans.impl.schema.XmlObjectFactory.parse( xmlText , opts);

     System.out.println("xo1:\n" + xo.xmlText(opts));
     System.out.println("\n");

     opts.setSavePrettyPrint();
     System.out.println("xo2:\n" + xo.xmlText(opts));

See Also:
  `CDataBookmark`, `CDataBookmark.CDATA_BOOKMARK`

#### isUseCDataBookmarks

    public boolean isUseCDataBookmarks()

#### setSaveSaxNoNSDeclsInAttributes

    public XmlOptions setSaveSaxNoNSDeclsInAttributes()

This option controls whether namespace declarations are included as attributes in the startElement event. By default, up to and including XMLBeans 2.3.0 they were included, in subsequent versions, they are no longer included.

#### setSaveSaxNoNSDeclsInAttributes

    public XmlOptions setSaveSaxNoNSDeclsInAttributes(boolean b)

#### isSaveSaxNoNSDeclsInAttributes

    public boolean isSaveSaxNoNSDeclsInAttributes()

#### setLoadReplaceDocumentElement

    public XmlOptions setLoadReplaceDocumentElement(QName replacement)

If this option is set, the document element is replaced with the given QName when parsing. If null is supplied, the document element is removed.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### getLoadReplaceDocumentElement

    public QName getLoadReplaceDocumentElement()

#### setLoadStripWhitespace

    public XmlOptions setLoadStripWhitespace()

If this option is set, all insignificant whitespace is stripped when parsing a document. Can be used to save memory on large documents when you know there is no mixed content.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadStripWhitespace

    public XmlOptions setLoadStripWhitespace(boolean b)

#### isSetLoadStripWhitespace

    public boolean isSetLoadStripWhitespace()

#### setLoadStripComments

    public XmlOptions setLoadStripComments()

If this option is set, all comments are stripped when parsing a document.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadStripComments

    public XmlOptions setLoadStripComments(boolean b)

#### isLoadStripComments

    public boolean isLoadStripComments()

#### setLoadStripProcinsts

    public XmlOptions setLoadStripProcinsts()

If this option is set, all processing instructions are stripped when parsing a document.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadStripProcinsts

    public XmlOptions setLoadStripProcinsts(boolean b)

#### isLoadStripProcinsts

    public boolean isLoadStripProcinsts()

#### setLoadLineNumbers

    public XmlOptions setLoadLineNumbers()

If this option is set, line number annotations are placed in the store when parsing a document. This is particularly useful when you want `XmlError` objects to contain line numbers.
Note: This adds line numbers info only for start tags. For line number info on end tags use: `setLoadLineNumbersEndElement()`

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`, `XmlError`

#### setLoadLineNumbers

    public XmlOptions setLoadLineNumbers(boolean b)

#### isLoadLineNumbers

    public boolean isLoadLineNumbers()

#### setLoadLineNumbersEndElement

    public XmlOptions setLoadLineNumbersEndElement()

If this option is set, line number annotations are placed in the store when parsing a document. This is particularly useful when you want `XmlError` objects to contain line numbers. Use the option to load line numbers at the end of an element.

#### setLoadLineNumbersEndElement

    public XmlOptions setLoadLineNumbersEndElement(boolean b)

#### isLoadLineNumbersEndElement

    public boolean isLoadLineNumbersEndElement()

#### setLoadSubstituteNamespaces

    public XmlOptions setLoadSubstituteNamespaces(Map<String,String> substNamespaces)

This option sets a map of namespace uri substitutions that happen when parsing a document.

This is particularly useful if you have documents that use no namespace, but you wish to avoid the name collision problems that occur when you introduce schema definitions without a target namespace.

By mapping the empty string "" (the absence of a URI) to a specific namespace, you can force the parser to behave as if a no-namespace document were actually in the specified namespace. This allows you to type the instance according to a schema in a nonempty namespace, and therefore avoid the problematic practice of using schema definitions without a target namespace.

Parameters:
  `substNamespaces` - a map of document URIs to replacement URIs
See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### getLoadSubstituteNamespaces

    public Map<String,String> getLoadSubstituteNamespaces()

#### setLoadTrimTextBuffer

    public XmlOptions setLoadTrimTextBuffer()

If this option is set, the underlying xml text buffer is trimmed immediately after parsing a document resulting in a smaller memory footprint. Use this option if you are loading a large number of unchanging documents that will stay in memory for some time.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadTrimTextBuffer

    public XmlOptions setLoadTrimTextBuffer(boolean b)

#### isLoadTrimTextBuffer

    public boolean isLoadTrimTextBuffer()

#### setLoadAdditionalNamespaces

    public XmlOptions setLoadAdditionalNamespaces(Map<String,String> nses)

Set additional namespace mappings to be added when parsing a document.

Parameters:
  `nses` - additional namespace mappings
See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### getLoadAdditionalNamespaces

    public Map<String,String> getLoadAdditionalNamespaces()

#### setLoadMessageDigest

    public XmlOptions setLoadMessageDigest()

If this option is set when loading from an InputStream or File, then the loader will compute a 160-bit SHA-1 message digest of the XML file while loading it and make it available via XmlObject.documentProperties().getMessageDigest();
The schema compiler uses message digests to detect and eliminate duplicate imported xsd files.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadMessageDigest

    public XmlOptions setLoadMessageDigest(boolean b)

#### isLoadMessageDigest

    public boolean isLoadMessageDigest()

#### setLoadUseDefaultResolver

    public XmlOptions setLoadUseDefaultResolver()

By default, XmlBeans does not resolve entities when parsing xml documents (unless an explicit entity resolver is specified). Use this option to turn on entity resolving by default.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setLoadUseDefaultResolver

    public XmlOptions setLoadUseDefaultResolver(boolean b)

#### isLoadUseDefaultResolver

    public boolean isLoadUseDefaultResolver()

#### setLoadUseXMLReader

    public XmlOptions setLoadUseXMLReader(XMLReader xmlReader)

By default, XmlBeans creates a JAXP parser, other parsers can be used by providing an XMLReader. For using the default JDK's SAX parser use: xmlOptions.setLoadUseXMLReader( SAXParserFactory.newInstance().newSAXParser().getXMLReader() );

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### getLoadUseXMLReader

    public XMLReader getLoadUseXMLReader()

#### setXqueryCurrentNodeVar

    public XmlOptions setXqueryCurrentNodeVar(String varName)

Sets the name of the variable that represents the current node in a query expression.

Parameters:
  `varName` - The new variable name to use for the query.
See Also:
  `XmlObject.execQuery(java.lang.String)`, `XmlCursor.execQuery(java.lang.String)`

#### getXqueryCurrentNodeVar

    public String getXqueryCurrentNodeVar()

#### setXqueryVariables

    public XmlOptions setXqueryVariables(Map<String,Object> varMap)

Map the names and values of external variables in an xquery expression. The keys of the map are the variable names in the query without the '$' prefix. The values of the map are objects and can be any of the primitive wrapper classes, String, XmlObject, or XmlCursor. The mapping only applies to xquery and has no effect on xpath expressions.

Parameters:
  `varMap` - a map from Strings to variable instances.
See Also:
  `XmlObject.execQuery(java.lang.String)`, `XmlCursor.execQuery(java.lang.String)`

#### getXqueryVariables

    public Map<String,Object> getXqueryVariables()

#### setDocumentSourceName

    public XmlOptions setDocumentSourceName(String documentSourceName)

This option sets the document source name into the xml store when parsing a document. If a document is parsed from a File or URI, it is automatically set to the URI of the source; otherwise, for example, when parsing a String, you can use this option to specify the source name yourself.

See Also:
  `XmlObjectFactory.parse(java.lang.String, XmlOptions)`

#### getDocumentSourceName

    public String getDocumentSourceName()

#### setCompileSubstituteNames

    public XmlOptions setCompileSubstituteNames(Map<QName,QName> nameMap)

This option allows for `QName` substitution during schema compilation.

Parameters:
  `nameMap` - a map from `QName`s to substitute `QName`s.
See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### getCompileSubstituteNames

    public Map<QName,QName> getCompileSubstituteNames()

#### setCompileNoValidation

    public XmlOptions setCompileNoValidation()

If this option is set, validation is not done on the Schema XmlBeans when building a `SchemaTypeSystem`

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### isCompileNoValidation

    public boolean isCompileNoValidation()

#### setCompileNoUpaRule

    public XmlOptions setCompileNoUpaRule()

If this option is set, the unique particle attribution rule is not enforced when building a `SchemaTypeSystem`. See Appendix H of the XML Schema specification for information on the UPA rule.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### setCompileNoUpaRule

    public XmlOptions setCompileNoUpaRule(boolean b)

#### isCompileNoUpaRule

    public boolean isCompileNoUpaRule()

#### setCompileNoPvrRule

    public XmlOptions setCompileNoPvrRule()

If this option is set, the particle valid (restriciton) rule is not enforced when building a `SchemaTypeSystem`. See Section 3.9.6 of the XML Schema specification for information on the PVR rule.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### setCompileNoPvrRule

    public XmlOptions setCompileNoPvrRule(boolean b)

#### isCompileNoPvrRule

    public boolean isCompileNoPvrRule()

#### setCompileNoAnnotations

    public XmlOptions setCompileNoAnnotations()

if this option is set, the schema compiler will skip annotations when processing Schema components.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### setCompileNoAnnotations

    public XmlOptions setCompileNoAnnotations(boolean b)

#### isCompileNoAnnotations

    public boolean isCompileNoAnnotations()

#### setCompileDownloadUrls

    public XmlOptions setCompileDownloadUrls()

If this option is set, then the schema compiler will try to download schemas that appear in imports and includes from network based URLs.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### setCompileDownloadUrls

    public XmlOptions setCompileDownloadUrls(boolean b)

#### isCompileDownloadUrls

    public boolean isCompileDownloadUrls()

#### setCompileMdefNamespaces

    public XmlOptions setCompileMdefNamespaces(Set<String> mdefNamespaces)

If this option is set, then the schema compiler will permit and ignore multiple definitions of the same component (element, attribute, type, etc) names in the given namespaces. If multiple definitions with the same name appear, the definitions that happen to be processed last will be ignored.

Parameters:
  `mdefNamespaces` - a set of namespace URIs as Strings
See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### getCompileMdefNamespaces

    public Set<String> getCompileMdefNamespaces()

#### setCompilePartialTypesystem

    public XmlOptions setCompilePartialTypesystem()

#### setCompilePartialTypesystem

    public XmlOptions setCompilePartialTypesystem(boolean compilePartialTypesystem)

#### isCompilePartialTypesystem

    public boolean isCompilePartialTypesystem()

#### setValidateOnSet

    public XmlOptions setValidateOnSet()

If this option is set when an instance is created, then value facets will be checked on each call to a setter or getter method on instances of XmlObject within the instance document. If the facets are not satisfied, then an unchecked exception is thrown immediately. This option is useful for finding code that is introducing invalid values in an XML document, but it slows performance.

See Also:
  `XmlObjectFactory.parse(java.io.File, XmlOptions)`

#### setValidateOnSet

    public XmlOptions setValidateOnSet(boolean b)

#### isValidateOnSet

    public boolean isValidateOnSet()

#### setValidateTreatLaxAsSkip

    public XmlOptions setValidateTreatLaxAsSkip()

Instructs the validator to skip elements matching an `<any>` particle with contentModel="lax". This is useful because, in certain situations, XmlBeans will find types on the classpath that the document author did not anticipate.

#### setValidateTreatLaxAsSkip

    public XmlOptions setValidateTreatLaxAsSkip(boolean b)

#### isValidateTreatLaxAsSkip

    public boolean isValidateTreatLaxAsSkip()

#### setValidateStrict

    public XmlOptions setValidateStrict()

Performs additional validation checks that are disabled by default for better compatibility.

#### setValidateStrict

    public XmlOptions setValidateStrict(boolean b)

#### isValidateStrict

    public boolean isValidateStrict()

#### setValidateTextOnly

    public XmlOptions setValidateTextOnly()

#### setValidateTextOnly

    public XmlOptions setValidateTextOnly(boolean b)

#### isValidateTextOnly

    public boolean isValidateTextOnly()

#### setUnsynchronized

    public XmlOptions setUnsynchronized()

This option controls whether or not operations on XmlBeans are thread safe. When not on, all XmlBean operations will be synchronized. This provides for multiple thread the ability to access a single XmlBeans simultaneously, but has a perf impact. If set, then only one thread may access an XmlBean.

#### setUnsynchronized

    public XmlOptions setUnsynchronized(boolean b)

#### isUnsynchronized

    public boolean isUnsynchronized()

#### setEntityResolver

    public XmlOptions setEntityResolver(EntityResolver resolver)

If this option is set when compiling a schema, then the given EntityResolver will be consulted in order to resolve any URIs while downloading imported schemas.

EntityResolvers are currently only used by compileXsd; they are not consulted by other functions, for example, parse. This will likely change in the future.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### getEntityResolver

    public EntityResolver getEntityResolver()

#### setBaseURI

    public XmlOptions setBaseURI(URI baseURI)

If this option is set when compiling a schema, then the given URI will be considered as base URI when deciding the directory structure for saving the sources inside the generated JAR file.

Parameters:
  `baseURI` - the URI to be considered as "base"
See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### getBaseURI

    public URI getBaseURI()

#### setSchemaCodePrinter

    public XmlOptions setSchemaCodePrinter(SchemaCodePrinter printer)

If this option is set when compiling a schema, then the given SchemaTypeCodePrinter.Printer will be used to generate the Java code.

See Also:
  `XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)`

#### getSchemaCodePrinter

    public SchemaCodePrinter getSchemaCodePrinter()

#### setCopyUseNewSynchronizationDomain

    public XmlOptions setCopyUseNewSynchronizationDomain(boolean useNewSyncDomain)

If this option is set to true, the return of XmlObject.copy() method will return an object in it's own synchronization domain, otherwise both objects will share the same synchronization domain, requiring explicit synchronization when concurent accessing the two objects.

Parameters:
  `useNewSyncDomain` - A flag representing the usage of new domain
See Also:
  `XmlObject.copy()`

#### isCopyUseNewSynchronizationDomain

    public boolean isCopyUseNewSynchronizationDomain()

#### setUseSameLocale

    public XmlOptions setUseSameLocale(Object localeOrXmlTokenSource)

#### getUseSameLocale

    public Object getUseSameLocale()

#### setLoadEntityBytesLimit

    public XmlOptions setLoadEntityBytesLimit(int entityBytesLimit)

Sets the maximum number of bytes allowed when an Entity is expanded during parsing. The default value is 10240 bytes.

Parameters:
  `entityBytesLimit` - the maximum number of bytes allowed when an Entity is expanded during parsing
Returns:
  this

#### getLoadEntityBytesLimit

    public Integer getLoadEntityBytesLimit()

#### setEntityExpansionLimit

    public XmlOptions setEntityExpansionLimit(int entityExpansionLimit)

Sets the maximum number of entity expansions allowed during parsing. The default value is 2048.

Parameters:
  `entityExpansionLimit` - the maximum number of entity expansions allowed during parsing
Returns:
  this

#### getEntityExpansionLimit

    public int getEntityExpansionLimit()

#### setLoadDTDGrammar

    public XmlOptions setLoadDTDGrammar(boolean loadDTDGrammar)

Controls whether DTD grammar is loaded during parsing. The default value is false.

Parameters:
  `loadDTDGrammar` - `true`, if DTD grammar is loaded during parsing
Returns:
  this

#### isLoadDTDGrammar

    public boolean isLoadDTDGrammar()

Returns whether DTD grammar is loaded during parsing. The default value is false.

Returns:
  `true`, if DTD grammar is loaded during parsing

#### setLoadExternalDTD

    public XmlOptions setLoadExternalDTD(boolean loadExternalDTD)

Controls whether external DTDs are loaded during parsing. The default value is false.

Parameters:
  `loadExternalDTD` - `true`, if external DTDs are loaded during parsing
Returns:
  this

#### isLoadExternalDTD

    public boolean isLoadExternalDTD()

Returns whether external DTDs are loaded during parsing. The default value is false.

Returns:
  `true`, if external DTDs are loaded during parsing

#### setDisallowDocTypeDeclaration

    public XmlOptions setDisallowDocTypeDeclaration(boolean disallowDocTypeDeclaration)

Controls whether DocType declarations are disallowed during XML parsing. If they are disallowed, the parser will throw an exception if a DocType declaration is encountered. The default value is false.

Parameters:
  `disallowDocTypeDeclaration` - `true`, if DocType declarations are to be disallowed
Returns:
  this
Since:
  5.0.2

#### disallowDocTypeDeclaration

    public boolean disallowDocTypeDeclaration()

Returns whether DocType declarations are disallowed during XML parsing. If they are disallowed, the parser will throw an exception if a DocType declaration is encountered. The default value is false.

Returns:
  `true`, if DocType declarations are to be disallowed
Since:
  5.0.2

#### setSaveOptimizeForSpeed

    public XmlOptions setSaveOptimizeForSpeed(boolean saveOptimizeForSpeed)

#### isSaveOptimizeForSpeed

    public boolean isSaveOptimizeForSpeed()

#### setSaaj

    public XmlOptions setSaaj(Saaj saaj)

#### getSaaj

    public Saaj getSaaj()

#### setLoadUseLocaleCharUtil

    public XmlOptions setLoadUseLocaleCharUtil(boolean useCharUtil)

#### isLoadUseLocaleCharUtil

    public boolean isLoadUseLocaleCharUtil()

#### setXPathUseSaxon

    public XmlOptions setXPathUseSaxon()

#### setXPathUseSaxon

    public XmlOptions setXPathUseSaxon(boolean xpathUseSaxon)

#### isXPathUseSaxon

    public boolean isXPathUseSaxon()

#### setXPathUseXmlBeans

    public XmlOptions setXPathUseXmlBeans()

#### setXPathUseXmlBeans

    public XmlOptions setXPathUseXmlBeans(boolean xpathUseXmlBeans)

#### isXPathUseXmlBeans

    public boolean isXPathUseXmlBeans()

#### setCompileAnnotationAsJavadoc

    public XmlOptions setCompileAnnotationAsJavadoc()

#### setCompileAnnotationAsJavadoc

    public XmlOptions setCompileAnnotationAsJavadoc(boolean useAnnotationAsJavadoc)

When generating the schema sources, copy over the schema annotations to the javadoc. Be aware basic code injection is filtered, but annotation based RCE aren't filtered. So think twice before activating this on untrusted schemas!

Parameters:
  `useAnnotationAsJavadoc` - `true` = copy the annotation - defaults to `false`

#### isCompileAnnotationAsJavadoc

    public boolean isCompileAnnotationAsJavadoc()

#### setAttributeValidationCompatMode

    public XmlOptions setAttributeValidationCompatMode(boolean attributeValidationCompatMode)

#### isAttributeValidationCompatMode

    public boolean isAttributeValidationCompatMode()

#### getCompilePartialMethod

    public Set<XmlOptions.BeanMethod> getCompilePartialMethod()

Returns:
  the list of methods to be generated in the XmlBean or `null` for all

#### setCompilePartialMethod

    public void setCompilePartialMethod(Set<XmlOptions.BeanMethod> list)

#### maskNull

    public static XmlOptions maskNull(XmlOptions o)

If passed null, returns an empty options object. Otherwise, returns its argument.

#### hasOption

    public boolean hasOption(XmlOptions.XmlOptionsKeys option)

Used to test a generic option

#### get

    public Object get(XmlOptions.XmlOptionsKeys option)

Used to get a generic option

#### remove

    public void remove(XmlOptions.XmlOptionsKeys option)