• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Empty nodes problem

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm using xerces and xalan and I have a problem with empty nodes. This appens when I create a DOM object from a XML file. I tried to use the "parser.setIncludeIgnorableWhitespace(false);" methode but nothing changes.
Can somebody help me ??
Thanks,
Manu
-------- CODE --------
Document dataDOM = null;
DOMParser parser = new DOMParser();
parser.setIncludeIgnorableWhitespace(false);
parser.parse("critere.xml");
dataDOM = parser.getDocument();

[This message has been edited by Manu Quartier (edited October 27, 2000).]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you mean by an "empty node"?
What kind of Node is it?
What are you expecting to be there?
How are you determining that it is empty?
Bill
 
Manu Quartier
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If critere.xml is :
<?xml version="1.0" encoding="ISO-8859-1"?>
<A>
<B crit="asd"/>
<A>
and the code is :
Document dataDOM = null;
DOMParser parser = new DOMParser();
parser.setIncludeIgnorableWhitespace(false);
parser.parse("critere.xml");
dataDOM = parser.getDocument();
String name = dataDOM.getFirstChild().getChildNodes().item(0).getNodeName()
then the value of name must be "B".
But the value is : "#text"
reply
    Bookmark Topic Watch Topic
  • New Topic