Using getElementById
Hi ,
I am trying to use the document.getElementById() method to obtain a value from the XML. I have done the following:
1. Defined the attribute as type ID [ <xsd:attribute name="id" type="xsd:ID" use="required" /> ]
2. Provided the schema location in the XML.
However in the code when I do a getElementById, I get a null.
Code snippet that I use is:
File capabilityfile = new Fiile("capabilities.xml");
URL capfile = capabilityfile.toURL();
oracle.xml.parser.v2.DOMParser parser = new oracle.xml.parser.v2.DOMParser();
parser.setValidationMode( XMLParser.SCHEMA_VALIDATION );
parser.parse( capfile );
Document capFileRoot = parser.getDocument();
System.out.println(capFileRoot.getElementById( "ASYNC"));
Am I missing something here?
Thanks,
Mridhula