[Adium-devl] O'Reilly XML blog article: Parsing XML… backwards?
Graham Booker
adium at cod3r.com
Wed Mar 14 19:19:46 UTC 2007
On Mar 14, 2007, at 2:09 PM, Peter Hosey wrote:
> On Mar 14, 2007, at 00:37:49, Colin Barrett wrote:
>> "</hello-->" is actually pretty easily solved. Don't generate the
>> "end of comment" until you hit a space or <!--.
>
> Bad solution. <!--hello--> is a legal comment that must be treated
> as such.
You would have to continually scan back through the document until
you encounter a "<!--" or a "-->". In the first case, you
encountered the end of a comment, in the second, the end of a tag.
Now for the question. What about:
<!--<badtag>yippie<!--<reallybadtag>!</reallybadtag></badtag>-->
First, not entirely up on my XML, but is the above legal? If so,
then finding the end (beginning in document order) of the comment
becomes lots of fun.
> ___________________________________
> \ Peter Hosey / boredzo at adiumx.com
> PGP public key ID: C6550423 (since 2007-01-01)
More information about the devel
mailing list