You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ed Staub <es...@mediaone.net> on 2000/08/01 18:42:21 UTC

RE: URGENT: Bug/special case in document() function when Xalan is used in Cocoon

I took a look at this in Cocoon 1.7.4/Xalan 1.0.1.

It looks like this should be handled by a fairly experienced Cocoon
contributor.
I was looking at it from the Xalan perspective.

Here are some notes for anyone digging on this:

Cocoon's XalanTransformer.XMLParser extends Xalan's XMLParserLiaisonDefault.

In order to support document(), Xalan needs the source URI to be associated
with the document within the XMLParserLiaisonDefault, using code like that
in Xalan's XSLTEngineImpl.setSourceDocument().

There probably should be a setSourceDocument() method on
XMLParserLiaisonDefault.

XalanTransformer never sets the source URI, but it can't anyway because the
URI is not accessible to it, either.  The Transformer interface might have
to be modified to support this.

I'm still digging upstream into Cocoon, to try to come up with a suggested
fix.
-Ed

-----Original Message-----
From: Edwards, Jayme [mailto:JCEdwards@software.rockwell.com]
Sent: Monday, July 31, 2000 4:39 PM
To: 'cocoon-dev@xml.apache.org'; 'xalan-dev@xml.apache.org';
'tomcat-dev@jakarta.apache.org'
Subject: URGENT: Bug/special case in document() function when Xalan is
used in Cocoon


Folks,

I've posted this issue a couple times in various forms. At this point I
cannot continue using Cocoon/Xalan for UI development until this is fixed. I
would really appreciate any cooperation I can get to get this into a dev
build in a timely manner.

RE: URGENT: Bug/special case in document() function when Xalan is used in Cocoon

Posted by Ed Staub <es...@mediaone.net>.
Berin,

Please refer to the original problem scenario from Jayme Edwards;
it describes using the second argument of a document() call to obtain the
base URI, per the XSLT spec.

I didn't mean to say that document() always fails under Cocoon.
However, it does fail in the above case.

-Ed Staub

-----Original Message-----
From: Berin Loritsch [mailto:bloritsch@infoplanning.com]
Sent: Tuesday, August 01, 2000 2:39 PM
To: cocoon-dev@xml.apache.org
Subject: Re: URGENT: Bug/special case in document() function when Xalan
is used in Cocoon


Ed Staub wrote:

> In order to support document(), Xalan needs the source URI to be
associated
> with the document within the XMLParserLiaisonDefault, using code like that
> in Xalan's XSLTEngineImpl.setSourceDocument().
>
> There probably should be a setSourceDocument() method on
> XMLParserLiaisonDefault.
>
> XalanTransformer never sets the source URI, but it can't anyway because
the
> URI is not accessible to it, either.  The Transformer interface might have
> to be modified to support this.
>
> I'm still digging upstream into Cocoon, to try to come up with a suggested
> fix.
> -Ed

I have used relative URI's with Cocoon/Xalan with good success. For
instance,

If I used the document("../menu.xml") function it always found what I am
looking
for.  Anytime you use absolute path/URLs in a web context you are asking for
trouble, and in this case you have found it.

The only way around it if you want absolute paths (relative to the document
root) is to have Cocoon modify the requested URI.  When it is embedded in
XSL like that, it makes it impracticle because a file: URI always goes
directly
to the filesystem--Cocoon has no interaction with it.


Re: URGENT: Bug/special case in document() function when Xalan is used in Cocoon

Posted by Berin Loritsch <bl...@infoplanning.com>.
Ed Staub wrote:

> In order to support document(), Xalan needs the source URI to be associated
> with the document within the XMLParserLiaisonDefault, using code like that
> in Xalan's XSLTEngineImpl.setSourceDocument().
> 
> There probably should be a setSourceDocument() method on
> XMLParserLiaisonDefault.
> 
> XalanTransformer never sets the source URI, but it can't anyway because the
> URI is not accessible to it, either.  The Transformer interface might have
> to be modified to support this.
> 
> I'm still digging upstream into Cocoon, to try to come up with a suggested
> fix.
> -Ed

I have used relative URI's with Cocoon/Xalan with good success. For instance,

If I used the document("../menu.xml") function it always found what I am looking
for.  Anytime you use absolute path/URLs in a web context you are asking for
trouble, and in this case you have found it.

The only way around it if you want absolute paths (relative to the document
root) is to have Cocoon modify the requested URI.  When it is embedded in
XSL like that, it makes it impracticle because a file: URI always goes directly
to the filesystem--Cocoon has no interaction with it.