cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heather Rankin" <>
Subject RE: problem with document() function
Date Wed, 11 Jun 2008 14:22:14 GMT
Hi Johannes,

Well firstly if you're using a variable to store your filename you
shouldn't need quotes around it. Should just be <xsl:value-of
select="document($filename)/NodeA/NodeB/NodeC" />

If that doesn't work it could be a problem with the path to your file or
the path to your nodes. The XML needs to be well formed, but if you're
not getting an error then that shouldn't be a factor. I'd make sure the
file path is correct by trying to output everything in the file
<xsl:value-of select="document($filename)/*" /> or use doc-available to
tell you.

According to your XML input your xpath looks ok (assuming first </NodeB>
is <NodeB>).


-----Original Message-----
From: Johannes Hoechstaedter [] 
Sent: 11 June 2008 14:58
Subject: Re: problem with document() function

Hi Heather,

yes I thought the same. Thats what I tried, only to test the document()

<xsl:value-of select="document('$filename')/NodeA/NodeB/NodeC" />

but I got no output. When I insert <xsl:value-of
select="doc-available('$filename')" /> for example, nothing works
anymore :)

The content of $filename is correct.

The xml structure of the file is:


Could it be still a path issue?

Heather Rankin schrieb:
> Hi Johannes,
> You should be able to use the document() function to interrogate the 
> contents of an external XML file. It is also a good idea to use
> doc-available() first to check for the existence of the file and build

> the tree in memory.
> Heather

To unsubscribe, e-mail:
For additional commands, e-mail:
This e-mail (and any attachments) is confidential and may contain personal views which are
not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify
the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message