Re: [xslt] Bug with the document("") function

On Wed, 2002-06-19 at 14:53, Daniel Veillard wrote:
> On Wed, Jun 19, 2002 at 02:19:56PM +0200, Eric van der Vlist wrote:
> > On Wed, 2002-06-19 at 14:04, Daniel Veillard wrote:
> > 
> > >    thanks for the report !
> > 
> > You're welcome.
> > 
> > Also, I haven't enough time to check your fix right, but 4xslt has an
> > issue with the fix they've applied when the XSLT transformation is given
> > as an existing DOM tree rather than as a file (in this case the original
> > DOM tree needs to be saved for later use which is a waste of memory but
> > I don't see what else could be done).
>   Well, in the case of libxslt, if the tree is built from scratch with DOM,
> it won't have a base URI, which means that document('') won't work and
> this is IMHO very sensible considering the definition of '' URI-Reference
> per RFC 2396. If you build an URI-Reference on a resource without base and
> that reference ain't sufficient to compute an URL well, you should get an
> error, isn't it ?

Yes, but OTH when you are working in memory you may want to generate a
XSLT transformation from existing trees and this transformation may want
to access to its own source.

4xslt does this by using a baseURI parameter in its StylesheetReader
module when a transformation is read from a DOM tree:

def fromDocument(self, document, baseUri='',isf=None):

It's probably not perfect but quite flexible!


> Daniel
> -- 
> Daniel Veillard      | Red Hat Network
>  | libxml GNOME XML XSLT toolkit
> | Rpmfind RPM search engine
> _______________________________________________
> xslt mailing list, project page
See you in San Diego.
Eric van der Vlist   

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]