Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Empty nodes problem

 
Manu Quartier
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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).]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • 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
  • 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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic