My problem is simple but I can't solve it !
I have an XML file (returned by Google Map Web Service), and in this file, I have lines which looks like this :
<name>Prendre la direction sud sur Rue Hubert Metzger vers Rue de l&#39;Ancien Théâtre</name>
In my code, I want to get the value of the node "name" by doing :
name = node.getFirstChild().getNodeValue();
If I print name, I obtain : "Prendre la direction sud sur Rue Hubert Metzger vers Rue de l"
The nodeValue is truncated when the apostrophe occurs... How can I do to get the entire nodeValue ?
Thank you for your answers !
In the DOM, the text of an element can be split into a number of text nodes, and getFirstChild() will return the first. Depending on what version of DOM this is, there are methods to "normalize" the DOM so all adjacent text nodes are concatenated, and there are methods to get the string value of an element node. But I forget the details - DOM is really horrible and I try to avoid it as much as possible.