[Expat-discuss] return tag contents as it is

Allen, Michael B (RSCH) Michael_B_Allen@ml.com
Tue, 21 Aug 2001 22:34:15 -0400


Well I don't think there is an existing facility for this however I suppose you could add a function to extract that information. If you can identify where exactly begin and end tags are discovered
you might set an unsigned int in the XML_Parser structure. Of course you would need to call your function in the begin and end tag handlers before the value is lost and it might need some positional
translation.

IMHO I don't think you should do what you're doing in the first place though. Storing tagged stuff in XML is error prone to say the least. You could write a much less obfuscated grammer to be parsed
with a yacc parser.

Mike

> -----Original Message-----
> From:	Lin Shen [SMTP:lshen@cisco.com]
> Sent:	Tuesday, August 21, 2001 9:58 PM
> To:	Allen, Michael B (RSCH); expat-discuss@lists.sourceforge.net
> Subject:	Re: [Expat-discuss] return tag contents as it is
> 
> What about getting the begin and end positions of the <grammar> tag in the
> buffer (whatever that is)? So that the contents can be copied out.
> 
> lin
> 
> ----- Original Message -----
> From: "Allen, Michael B (RSCH)" <Michael_B_Allen@ml.com>
> To: "'Lin Shen'" <lshen@cisco.com>; <expat-discuss@lists.sourceforge.net>
> Sent: Tuesday, August 21, 2001 6:16 PM
> Subject: RE: [Expat-discuss] return tag contents as it is
> 
> 
> > I don't think so. That would be an extra feature of an XML parser. Perhaps
> you
> > can use the special CDATA tag into which you may put anything including
> xml.
> >
> > > -----Original Message-----
> > > From: Lin Shen [SMTP:lshen@cisco.com]
> > > Sent: Tuesday, August 21, 2001 9:11 PM
> > > To: expat-discuss@lists.sourceforge.net
> > > Subject: [Expat-discuss] return tag contents as it is
> > >
> > > Hi,
> > >
> > > Is it possible to have the parser return the contents of certain tags as
> it
> > > is? For instance, for the following xml segment
> > >
> > > <grammar>
> > >     <rule id="root">
> > >         text <ruleref tag="&lt tag &gt"/>
> > >     </rule>
> > > </grammar>
> > >
> > > is there is a way to let the parser to return whatever contained in
> > > <grammar> tag w/out any parsing, including the escape char and the
> <rule>
> > > tag?
> > >
> > > Please send reply to my personal account lshen@cisco.com
> > >
> > > thanks
> > > lin
> > >
> > >
> > > _______________________________________________
> > > Expat-discuss mailing list
> > > Expat-discuss@lists.sourceforge.net
> > > http://lists.sourceforge.net/lists/listinfo/expat-discuss
> >
>