cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@infoplanning.com>
Subject Re: Document function bug... Urgent!!!
Date Wed, 18 Oct 2000 13:00:37 GMT

----- Original Message ----- 
From: "Didier Villevalois" <dvillevalois@sqli.com>
To: <cocoon-users@xml.apache.org>; <cocoon-dev@xml.apache.org>
Cc: <xalan-dev@xml.apache.org>
Sent: Wednesday, October 18, 2000 6:57 AM
Subject: Document function bug... Urgent!!!


> Hello,
> 
> I'm still trying to understand why the document() function does not
> work correctly. I told you that bug since cocoon 1.4 but it seems
> nobody took attention.
> 
> And i now think it comes from cocoon's liaison between Xerces and
> Xalan.
> 
> I think you don't feed it with the correct path of the source file
> when running through the cocoon pipe. This makes the
> parserLiaison.findUriFromDoc
> returning a wrong path and the document() function to fail when used
> with a second argument being a node from this source file.
> 
> Thanks for your help.

It works for me.

> 
> This is a forwarded message
> From: Benoit Cerrina <benoit.cerrina@writeme.com>
> To: xalan-dev@xml.apache.org <xalan-dev@xml.apache.org>
> Date: Saturday, October 14, 2000, 2:24:47 PM
> Subject: [XalanJ-1.2D02] Document function... Could not load requested doc
> 
> ===8<==============Original message text===============
> Hi,
> I've also observed this behavior and reduced myself to using absolute URIs,
> I believe there is a bug there.
> Benoit
> ----- Original Message -----
> From: "Didier Villevalois" <dvillevalois@sqli.com>
> To: <xalan-dev@xml.apache.org>
> Sent: Friday, October 13, 2000 7:46 PM
> Subject: Re[2]: [XalanJ-1.2D02] Document function... Could not load
> requested doc
> 
> 
> > Hello Joseph,
> > you wrote:
> > Jlc> From the XSLT spec:
> > Jlc>        When the first argument to the document function is not a
> node-set,
> > Jlc> the first argument is converted
> > Jlc>        to a string as if by a call to the string function. This
> string is
> > Jlc> treated as a URI reference;
> >
> > Jlc> Relative URI references, such as your 'toto.xml', are interpreted in
> terms
> > Jlc> of the base URI at that point in the document. The question is, which
> > Jlc> document -- the souce document, or the stylesheet?  Checking the spec
> > Jlc> again:

In practice, the relative URI is relative to the stylesheet for finding the file.

> >
> > Jlc>        The URI reference may be relative. The base URI (see [3.2 Base
> URI])
> > Jlc> of the node in the second
> > Jlc>        argument node-set that is first in document order is used as
> the
> > Jlc> base URI for resolving the relative
> > Jlc>        URI into an absolute URI. If the second argument is omitted,
> then it
> > Jlc> defaults to the node in the
> > Jlc>        stylesheet that contains the expression that includes the call
> to
> > Jlc> the document function.
> >
> > That is exactly what i had understood so why document('toto.xml',
> > .) when '.' is a node from the source document doesn't open the
> > toto.xml in the directory of the source document??
> >
> > When i say document('toto.xml', .) and . is a node of the source
> > document, xalan says the base uri is "d:\catalina\" ...

Just use document('toto.xml') and it will insert at the current location.
Just make sure you surround with <xsl:copy> tag.



Mime
View raw message