Johannes, If you don't like absolute paths then you just need to figure
out where your XSLT is relative to your XML doc. If your XSL is in say,
'COB-INF/resource/internal/sql/transformation' you'll need
'../resource/internal/sql/configuration/filename' (with file extension
of course).  

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

Go away with absolute paths !!!!

Lehtonen, Mika schrieb:
> Hi Johannes,
>
> maybe you could try absolute path like:
>
>    * UNIX ... file:///foo/bar/this.xsl
>    * Windows ... file:///C:/foo/bar/this.xsl
>
> Just to make sure that the file is fetched from the right location.
>
> - mika -
>
>
> Johannes Hoechstaedter kirjoitti:
>> 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:[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]
>>>
>>>
>>>
>>>   
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

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