I have an xml file that I am parsing and I have the following tag...
<desc>
/wap/news/text.jsp?sid=242&nid=5662369&cid=5038&scid=-1
</desc>
I don't have control over the format of this xml file but I need to interpret the desc content as a partial url that I will later append to a base URL and retrieve a new file.
When I parse this the desc tag has one child, a text node with a value of...
/wap/news/text.jsp?sid=242
but the rest of the line is parsed as 6 child nodes on the above text node with values of...
&
nid=5662369
&
cid=5038
&
scid=-1
How do I make the parser treat this as just a single text node and not interpret the '&' symbols as child nodes.
The relevant parsing code is below.
HttpConnection c = (HttpConnection) Connector.open(inURL.toString(), Connector.READ);
is = c.openInputStream();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringElementContentWhitespace(true);
factory.setAllowUndefinedNamespaces(true);
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(is);
This is J2ME code on a blackberry so I'm pretty limited as to the APIs I have available.