- Javax.xml.bind classes
- Home
- Binder
- DatatypeConverter
- JAXB
- JAXBContext
- JAXBElement
- JAXBElement.GlobalScope
- JAXBIntrospector
- Marshaller.Listener
- SchemaOutputResolver
- Unmarshaller.Listener
- Javax.xml.bind.util classes
- JAXBResult
- JAXBSource
- ValidationEventCollector
- Javax.xml.parsers classes
- DocumentBuilder
- DocumentBuilderFactory
- SAXParser
- SAXParserFactory
- Javax.xml.soap classes
- AttachmentPart
- MessageFactory
- MimeHeader
- MimeHeaders
- SAAJMetaFactory
- SOAPConnection
- SOAPConnectionFactory
- SOAPFactory
- SOAPMessage
- SOAPPart
- Javax.xml.validation classes
- Schema
- SchemaFactory
- TypeInfoProvider
- Validator
- ValidatorHandler
- Javax.xml.xpath classes
- XPathConstants
- XPathFactory
- Java Useful Resources
- Java - Quick Guide
- Java - Useful Resources
DocumentBuilder isXIncludeAware() Method
Description
The Javax.xml.parsers.DocumentBuilder.isXIncludeAware() method gets the XInclude processing mode for this parser.
Declaration
Following is the declaration for Javax.xml.parsers.DocumentBuilder.isXIncludeAware() method
public boolean isXIncludeAware()
Parameters
NA
Return Value
This method returns the return value of the DocumentBuilderFactory.isXIncludeAware() when this parser was created from factory.
Exception
NA
Example
For our examples to work, a xml file named Student.xml is needed in our CLASSPATH. The contents of this XML are the following −
<?xml version = "1.0" encoding = "UTF-8" standalone = "yes"?> <student id = "10"> <age>12</age> <name>Malik</name> </student>
The following example shows the usage of Javax.xml.parsers.DocumentBuilder.isXIncludeAware() method.
package com.tutorialspoint; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class DocumentBuilderDemo { public static void main(String[] args) { // create a new DocumentBuilderFactory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { // use the factory to create a documentbuilder DocumentBuilder builder = factory.newDocumentBuilder(); // check if builder is XInclude aware System.out.println("" + builder.isXIncludeAware()); // use the factory again to create another documentbuilder factory.setXIncludeAware(true); DocumentBuilder builder2 = factory.newDocumentBuilder(); // check if builder2 is XInclude aware System.out.println("" + builder2.isXIncludeAware()); } catch (Exception ex) { ex.printStackTrace(); } } }
If we compile the code and execute it, this will produce the following result −
false true
javax_xml_parsers_documentbuilder.htm
Advertisements