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>).

Heather

-----Original Message-----
From: Johannes Hoechstaedter [mailto:[EMAIL PROTECTED] 
Sent: 11 June 2008 14:58
To: users@cocoon.apache.org
Subject: Re: problem with document() function

Hi Heather,

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

<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:

<NodeA>
    </NodeB>       
        <NodeC>
            text
        </NodeC>     
    </NodeB>
</NodeA>

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


http://www.bbc.co.uk/
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to