I've got a kml file(essentially xml) which has a set of nodes; name, description, coordinates etc. Up until now I have only been getting two values; name and coordinates. Now I want to get the description data as well, the only problem is that it is CData and when parsed it is ignored.
I've been using XQuery to get the data so far;
XPathExpression expr = xpath.compile("//name/text()");
Object result = expr.evaluate(doc, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
for...
In the kml file its just <![CDATA[.....]>as opposed to "101" (an actual string) Using the same query it returns nothing.
The kml file has structure:
<Document>
<Placemark>
<name>101</name>
<description><![CDATA[.....]]></description>
<polygon>
<coordinates>......</coordinates>
</polygon>
</Placemark>
<Placemark>
....
</Placemark>
</Document>
Is there a way to do it through XQuery?
//description/text()? The information inside of the CDATA should be returned astext()content. - Mads Hansen/, unclosed element, CDATA not properly closed). - Jens Erat