[XML-SIG] Using PyExpat.py

Uche Ogbuji uche.ogbuji@fourthought.com
Mon, 19 Feb 2001 15:22:15 -0700


> Sure, one can add a parseFile, but what do you do with
> 
> <?xml version='1.0'?>
> <!DOCTYPE spam [
>   <!ENTITY foo SYSTEM 'foo.bar'>
> ]>
> <spam>&foo;</spam>
> 
> URI or file?
> 
> Note that this is a trick question, and the "trick" is *exactly* my point.

On re-reading, it seems as if I'm trying to be coy, but I'm not.

My point is that "foo.bar" must be evaluated against the base URI of the 
entity in which it is contained.  Here we have no choice of letting the user 
say "parseFile" or "parseUri".

The same trap is all over the place:

<foo xml:base='python.org'/>

<xsl:import href='style-lib.xslt'/>

<xsl:include href='cool-template.xslt'/>

<spam>
<xinclude:include href='wannabe-entity.xml'/>
</spam>

<rdf:Description about='inline-web-page' dc:creator='Uche Ogbuji'/>

<mylink xlink:type="simple"
        xlink:href="destination.xml"
        xlink:actuate="onLoad"
        xlink:show="replace"
        attribute="value"
/>

Basically, if you want to play with XML, you have to play with URI.  There's 
not much for it.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python