Browsers contain XML parsers (whatever you choose to call them, they
still parse XML). Those parsers look for and close unclosed tags
before rendering. My point stands.
There is also HTML Tidy which parses XML for errors. It can and does
close unclosed tags if you ask it to. So that's another case where
your analogy fails.
XML requires closed tags. XML parsers require closed tags. if your
document requires pre-processing before it goes through the XML
parser, then it isn't XML. and if your parser allows unclosed tags,
then it's not an XML parser.
but the point i was making was that since the OP is looking to parse
input which potentially contains unclosed tags, she can't use the
DocumentBuilder interface, because that uses an XML parser.
therefore, she will require either a preprocessor to make the
document compliant before submitting it to the XML parser, or use a
forgiving HTML parser to make a Document object.
and your post, pointing out that browsers will under some conditions
(and not, by the way, if the document is declared to be XML or XHTML,
otherwise they are noncompliant) close your tags for you, doesn't
actually help or provide any useful information at all, DOES IT??
and no, HTML is most definitely *not* XML.
--
jason.vp.engineering.particle
--
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