You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andreas Neuenschwander <an...@andi.ch> on 2001/04/25 11:27:25 UTC

[C2] XSL document() function

I tried to use the XSL document('file.xml') Function in Cocoon2 like this:


<xsl:stylesheet ...>
<xsl:variable name="currencies" select="document('codes.xml')/currencies"/>
...
<xsl:template match="/">
...
  <xsl:value-of select="$currencies/currency/name"/>
...
</xsl:template>

</xsl:stylesheet>


I can't access any node in the referenced 'codes.xml' file.

Is this XSL feature supported in C2?


Thx





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] XSL document() function

Posted by David Allen <ho...@dial.pipex.com>.
I have also had this problem. It seems that Xalan only supports absolute
URLs so use a call like document ('http://...../file.xml')
David Allen

Conny Krappatsch wrote:
> 
> On Wednesday 25 April 2001 11:27, Andreas Neuenschwander wrote:
> > I tried to use the XSL document('file.xml') Function in Cocoon2 like this:
> >
> >
> > <xsl:stylesheet ...>
> > <xsl:variable name="currencies" select="document('codes.xml')/currencies"/>
> > ....
> > <xsl:template match="/">
> > ....
> >   <xsl:value-of select="$currencies/currency/name"/>
> > ....
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> >
> > I can't access any node in the referenced 'codes.xml' file.
> >
> > Is this XSL feature supported in C2?
> 
> This is not a Cocoon but an XSLT problem. You better ask such questions on an
> XSL list.
> 
> Anyhow, try this variable declaration instead of yours:
> 
> <xsl:variable name="currencies">
>     <xsl:copy-of select="document('codes.xml')/currencies"/>
> </xsl:variable>
> 
> (and double and tripple check spelling ;-)
> 
> regards,
> Conny
> 
> --
> ______________________________________________________________________
> Conny Krappatsch                              mailto:conny@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

-- 
International Press Telecommunications Council
Working to improve the efficiency of News exchange.
Visit our Web Site at  http://www.iptc.org

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] XSL document() function

Posted by Conny Krappatsch <co...@smb-tec.com>.
On Wednesday 25 April 2001 11:27, Andreas Neuenschwander wrote:
> I tried to use the XSL document('file.xml') Function in Cocoon2 like this:
>
>
> <xsl:stylesheet ...>
> <xsl:variable name="currencies" select="document('codes.xml')/currencies"/>
> ....
> <xsl:template match="/">
> ....
>   <xsl:value-of select="$currencies/currency/name"/>
> ....
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> I can't access any node in the referenced 'codes.xml' file.
>
> Is this XSL feature supported in C2?

This is not a Cocoon but an XSLT problem. You better ask such questions on an 
XSL list.

Anyhow, try this variable declaration instead of yours:

<xsl:variable name="currencies">
    <xsl:copy-of select="document('codes.xml')/currencies"/>
</xsl:variable>

(and double and tripple check spelling ;-)


regards,
Conny

-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>