[reportlab-users] pyRXP and processing instructions

Andy Robinson reportlab-users@reportlab.com
Mon, 3 Mar 2003 22:30:08 -0000


> In theory, we could return more intelligent classes than 'tuple' now
> without sacrificing backwards compatibility, speed or memory by 
> subclassing
> tuple (?). Perhaps a real life DOM tree could be returned via 
> parser.Parse()?
> I havn't looked to closely at this yet - it is still in blue sky stage.

I think this indicates an ideal approach for a "version 2.0" if/when
enough people had the energy.  One could make lightweight types
in C with the richness to represent a full DOM model, so that those
who wished to see all node types could retrieve them, and so
we could add new attributes in future without any risk to
existing code.  I think there are something like 9 distinct node 
types needed to represent XML accurately...

We originally thought of pyRXP as "read only" but many people
seem to want to rewrite XML.  If you want to rewrite, then you 
need a richer model, as well as offsets into the original file
to locate the positions spanned by tags.  This could lead to
super-fast-and-accurate rewriting by saying "this tag is unchanged,
just echo out the text it originally came from"...

The other thing we should probably look at is namespaces, which
are there in RXP but not exposed.  

- Andy