You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jeremy Sheeley <je...@sourcegear.com> on 2001/01/11 00:12:33 UTC
Peeking forward
I have a problem building a parser for WML.
The following is a valid WML fragment
<anchor>
Link Text
<go href="http://www.google.com"/>
</anchor>
This is the same as:
<a href="http://www.google.com">Link Text</a>
The problem is that inside an anchor, WML allows text (and some other
tags, even) to come before the action (in this case the go tag). What I
need to do is when I'm dealing with the startElement of anchor, search
the file for the go tag so that I can know that all child elements of
this anchor have the href pointing to google.com. I could then parse
the rest of the elements as if it had been declared in an <a>. Does
anyone have any good ideas? I've looked through the progressive parsing
example, but would prefer not to rearchitect the parser. Thanks in
advance.
-Jeremy Sheeley
Sourcegear