Why Node.getNodeValue() method does not return the string after(&)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aminur_rashid
Posted On:   Friday, July 13, 2001 06:48 AM

Please help me! Below is the XML file's content: Algebraic& Statistical calculator When I want to get the value of by following quotes: String value = ""; NodeList children = node.getChildNodes(); for(int i = 0; i < children.getLength(); i++ ) { Node ci = children.item(i); if( ci.getNodeType() == Node.TEXT_NODE ) { value = value + ci.getNodeValue(); } } it gives me only Algebraic(Rest part after & gets truncated)can't I get the entiretext inside it?    More>>


Please help me! Below is the XML file's content:



Algebraic& Statistical calculator



When I want to get the value of by following quotes:



String value = "";

NodeList children = node.getChildNodes();
for(int i = 0; i < children.getLength(); i++ )
{
Node ci = children.item(i);
if( ci.getNodeType() == Node.TEXT_NODE )
{
value = value + ci.getNodeValue();
}
}




it gives me only Algebraic(Rest part after & gets truncated)can't I get the entiretext inside it?


   <<Less

Re: Why Node.getNodeValue() method does not return the string after(&)

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, July 13, 2001 11:55 AM

Hi,

Because the '&' sign it's a special character (in HTML too). In an XML file you need to use the '&' entity to represent it...
About | Sitemap | Contact