Applying an XSD to a fragment of the document.

N

n4te

I am using a SAX parser (javax.xml.parsers.SAXParser) to parse a
document. I have an element that contains an any node...

<xs:element name="extension" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded"
processContents="lax"/>
</xs:sequence>
<xs:attribute name="uid" type="xs:string"/>
</xs:complexType>
</xs:element>

Using this element's "uid" attribute I can lookup an XSD that I need to
apply to all elements within this element. Is there a way I can do this
programmatically, without requiring the XML document author to put in
the xmlns and SchemaLocation?

Here is a link to the source for my parser:

http://tinyurl.com/5gfsf

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top