File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Using JAXP 1.1 and Xerces 1.4.1 : Get empty document children nodes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Using JAXP 1.1 and Xerces 1.4.1 : Get empty document children nodes" Watch "Using JAXP 1.1 and Xerces 1.4.1 : Get empty document children nodes" New topic
Author

Using JAXP 1.1 and Xerces 1.4.1 : Get empty document children nodes

yvs100
Greenhorn

Joined: Jul 31, 2001
Posts: 3
I am using Jaxp 1.1 and Xerces 1.4.1 to parse XML documents. I am using setValidating(true), setIgnoringComments(true), setIgnoringElementContentWhitespace(true) and setNamespaceAware ( true )while setting the configuration options for the DocumentBuilderFactory. When parsing XML with DTD doctype everything goes on OK but when I use grammer specified in a XML schema definition (xsd file) I get a document which has all empty children nodes.
To make sure that my XML is valid I used the DOMCount class (which came with Xerces1.4.1 in the XercesSamples.jar) with validation ON. It seems to count all the elements in the XML OK. So I think my XML is valid.
What am I missing? Is there some other option which I am not setting? Or is there something specific I need to do in my xsd?
Any help greatly appreciated.
Thanks
Yash.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

is this the Yash, i know....
just curious...don't want to reveal more details here...
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
yvs100
Greenhorn

Joined: Jul 31, 2001
Posts: 3
Originally posted by Madhav Lakkapragada:

is this the Yash, i know....
just curious...don't want to reveal more details here...
- satya

Yes. I am. Do you also know the solution to my problem?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Welcome, Yash.
I will try to get some help....
- satya
yvs100
Greenhorn

Joined: Jul 31, 2001
Posts: 3
Originally posted by Madhav Lakkapragada:

Welcome, Yash.
I will try to get some help....
- satya

I was hoping to use the abstraction provided by JAXP so that I can plug in any XML parser in the future. Xerces 1.4.1 - I think claims only Beta support for JAXP. Has any body used Xerces as parser with JAXP API in the code?
BTW The DOMCount class shipped in the XercesSamples.jar has almost all the same options to the Document Builder. It referes to them by their actual names, viz. "http://xml.org/sax/features/validation" etc.
Thanks in advance for any clue, help you can provide.
Yash Sathaye
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using JAXP 1.1 and Xerces 1.4.1 : Get empty document children nodes
 
Similar Threads
XML Validation
Jboss class cast exception: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
XML Validation
XML Validation
URGENT - Setting feature for SAX Parser in Xerces.