cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Hoechstaedter <j.hoechstaed...@memocomp.de>
Subject Re: problem with document() function
Date Wed, 11 Jun 2008 14:40:39 GMT
The value of the variable $filename is correct, because I use this 
variable three times in the same stylesheet within xi:include 
statements, and it works. So the output of <xsl:value-of 
select="$filename" /> is correct. The output of <xsl:value-of 
select="document($filename)/*" /> is empty, and I get no error. Just an 
empty value, where should be a value.

The file is located in "COB-INF/resource/internal/sql/configuration", 
and I access it by "resource/internal/sql/configuration/filename". I 
think it is correct or?.

Heather Rankin schrieb:
> 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:j.hoechstaedter@memocomp.de] 
> 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message