[reportlab-users] pyRXP and processing instructions

Robin Becker reportlab-users@reportlab.com
Mon, 3 Mar 2003 16:29:37 +0000


In article <79957532.1046699769@[192.168.0.2]>, Andreas Jung
<lists@andreas-jung.com> writes
......
>
>I think processing instructions should be represented by a new node
>that makes the PI available for later processing. A callback is not
>very useful since processing happens after pyRXP would have created
>the nested tuple representation.
>
>Andreas
well I introduced part of a patch that was contributed by Stuart for
unicode. That makes processing instructions available as text if you put
the ReturnProcessingInstructions flag on.

The same problem still exists as with comments ie comments outside the
outer tag are strange, unless you use ReturnList=1.

Therefore the only way to get something useful from '<?pi x=3?><a/>'
involves accepting an extra layer outside the single real tag is to set
ReturnList=1 (and in this case ReturnProcessingInstructions=1).

There's also at present no way to distinguish between real text and
processing instructions if you have ampersands coming in.

The correct thing to do with both comments and processing instructions
is as said before to create special nodes with 'odd' names.

Since tag names cannot contain '<' I suppose the correct names should
probably be '<!--' and '<?'.

Not that according to my micro knowledge of xml and also to the rxp
compiler the <?xml ....?> at the front of xml is not a processing
instruction.

Is anyone using the ReturnComments flag?
-- 
Robin Becker