This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Machine Learning with TensorFlow and have Chris A. Mattmann on-line!
See this thread for details.
Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is this the Yash, i know....
just curious...don't want to reveal more details here...
- satya
 
yvs100
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Welcome, Yash.
I will try to get some help....
- satya
 
yvs100
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic