You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Peter C. Verhage" <pe...@zeelandnet.nl> on 2001/01/31 18:30:18 UTC

Logicsheets, and relative paths

I've created a logicsheet with uses the "document(...)" function of XSLT to
parse a certain XML (config) file. In the main XML file, which uses the
logicsheet, I specify the path to the other XML file. Unfortunately this can
only be a absolute path, because if I use a relative path, it will be
relative to the path wherever the logicsheet is within the system. How can I
overcome this problem, and use relative paths, that are relative to the main
XML file?

Regards,

Peter



Re: Logicsheets, and relative paths

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> logicsheets in c1 have access to the full path to the source xml file by
> declaring a filename parameter:
> 
> <xsl:param name="filename"/>
> 
> that might help you out.

Is there any documentation on this and other parameters passed to the
XSL stylesheet? Recently someone said in a byline Cookies are also
passed to the stylesheet - is there a specific place in the source code,
where all these are listed?

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Logicsheets, and relative paths

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 1 Feb 2001, Peter C. Verhage wrote:

> No I cannot. Because you are saying I have to use some JAVA for this. But I
> don't want that, because it has got to parse the data from the configuration
> file once, and do something with it, and with the result of that create the
> *.java and *.class file for the page.
>
> So I don't want to include the file with JAVA, but just use the "document()"
> function of XSLT. In the XML file I just want to name a relative path to the
> configuration (XML) file, and the logicsheet has to read this file with XSLT
> and create the *.java file with some of it's own data, and some of the
> configuration file. This all works when I use absolute paths, or relative
> paths from the logicsheet. But not relative paths from the main XML file :/.

logicsheets in c1 have access to the full path to the source xml file by
declaring a filename parameter:

<xsl:param name="filename"/>

that might help you out.

- donald


Re: Logicsheets, and relative paths

Posted by "Peter C. Verhage" <pe...@zeelandnet.nl>.
: Since the logicsheet is compiled in as part of the XML page you can find
: out its URL from within the logicsheet and take it from there.
:
: Ulrich

No I cannot. Because you are saying I have to use some JAVA for this. But I
don't want that, because it has got to parse the data from the configuration
file once, and do something with it, and with the result of that create the
*.java and *.class file for the page.

So I don't want to include the file with JAVA, but just use the "document()"
function of XSLT. In the XML file I just want to name a relative path to the
configuration (XML) file, and the logicsheet has to read this file with XSLT
and create the *.java file with some of it's own data, and some of the
configuration file. This all works when I use absolute paths, or relative
paths from the logicsheet. But not relative paths from the main XML file :/.

I personally don't think there's a solution really :/, besides using
absolute paths.

Regards,

Peter


Re: Logicsheets, and relative paths

Posted by Uli Mayring <ul...@denic.de>.
On Wed, 31 Jan 2001, Berin Loritsch wrote:

> "Peter C. Verhage" wrote:
> > 
> > I've created a logicsheet with uses the "document(...)" function of XSLT to
> > parse a certain XML (config) file. In the main XML file, which uses the
> > logicsheet, I specify the path to the other XML file. Unfortunately this can
> > only be a absolute path, because if I use a relative path, it will be
> > relative to the path wherever the logicsheet is within the system. How can I
> > overcome this problem, and use relative paths, that are relative to the main
> > XML file?
> 
> The only way to do it that way is to make all your paths relative to
> the XSL file.
> 
> If you want to include documents relative to the XML path, and do not
> mind having the include statement in the original XML document you
> can use XInclude or the util:include-file tag.

Since the logicsheet is compiled in as part of the XML page you can find
out its URL from within the logicsheet and take it from there.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Softwareentwicklung


Re: Logicsheets, and relative paths

Posted by Berin Loritsch <bl...@apache.org>.
"Peter C. Verhage" wrote:
> 
> I've created a logicsheet with uses the "document(...)" function of XSLT to
> parse a certain XML (config) file. In the main XML file, which uses the
> logicsheet, I specify the path to the other XML file. Unfortunately this can
> only be a absolute path, because if I use a relative path, it will be
> relative to the path wherever the logicsheet is within the system. How can I
> overcome this problem, and use relative paths, that are relative to the main
> XML file?

The only way to do it that way is to make all your paths relative to
the XSL file.

If you want to include documents relative to the XML path, and do not
mind having the include statement in the original XML document you
can use XInclude or the util:include-file tag.