Happy new years :)
I am using SAXParser to parse an html page (any better solution?) and
have this exception:
W/System.err( 1358): org.apache.harmony.xml.ExpatParser
$ParseException: At line 1, column 59: not well-formed (invalid token)
I have reduced the page to this:
<div id="submenu"><a href="/compte/console.pl?
id=382730&idt=1cf6b94aa1a4cf84"></a></div>
and what causes the exception is the '&' inside the href attribute
value.
Here is a minimalist test code:
DefaultHandler emptySaxHandler = new DefaultHandler() {};
String xmlstr = "<div id=\"submenu\"><a href=\"/compte/
console.pl?id=382730&idt=1cf6b94aa1a4cf84\"></a></div>";
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(new ByteArrayInputStream(xmlstr.getBytes
()),emptySaxHandler);
is this a normal behaviour or kind of bug? if normal, what should do
to preprocess the string before parsing?
Thks for any help,
Thierry.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en