[reportlab-users] pyRXP and processing instructions

Dennis Allison reportlab-users@reportlab.com
Mon, 3 Mar 2003 12:51:43 -0800 (PST)


In the limited context I used it, it worked since I knew that anything
that looked like a comment was one in the domain my special purpose tool
was used.  Pushing it down a level would have been a better solution, but
I did not have the time to hack the code...

-d

On Mon, 3 Mar 2003, Robin Becker wrote:

> In article <Pine.LNX.4.10.10303030843420.16047-100000@sumeru.stanford.EDU>, Dennis Allison
> <allison@sumeru.stanford.EDU> writes
> >
> >
> >On Mon, 3 Mar 2003, Robin Becker wrote:
> >
> >> Is anyone using the ReturnComments flag?
> >> -- 
> >> Robin Becker
> >
> >Yes, I use it when I parse XML and plan to later reconstruct as one does
> >for an edit.  It's important in that context to maintain comments :-)
> >
> .....how do you distinguish comments from other stray text? eg if I do
> 
> >>> pyRXP.Parser(ReturnComments=1)('<a><!-- this looks like a comment--></a>')
> ('a', None, ['<!-- this looks like a comment-->'], None)
> >>> pyRXP.Parser(ReturnComments=1)('<a>&lt;!-- this looks like a comment--></a>')
> ('a', None, ['<!-- this looks like a comment-->'], None)
> >>> 
> 
> the two results look identical. If other text follows they start to look different
> 
> eg
> >>> pyRXP.Parser(ReturnComments=1)('<a><!-- this looks like a comment-->hahahah</a>')
> ('a', None, ['<!-- this looks like a comment-->', 'hahahah'], None)
> >>> pyRXP.Parser(ReturnComments=1)('<a>&lt;!-- this looks like a comment-->hahahah</a>')
> ('a', None, ['<!-- this looks like a comment-->hahahah'], None)
> >>> 
> 
> I think people are saying it would be better if the comments were pushed down one level.
> 
> eg
> >>> pyRXP.Parser(ReturnComments=1)('<a><!-- comment-->hahahah</a>')
> ('a', None, [('<!--', None, ['comment'], None), 'hahahah'], None)
> 
> 
> and had a special tag name eg '<!--'
> -- 
> Robin Becker
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>