Re: RE: [xsl] XPath to match XML from Cocoon Request Generator

Subject: Re: RE: [xsl] XPath to match XML from Cocoon Request Generator
From: Tim Heighes <Tim.Heighes@xxxxxxxxxxxxxxxx>
Date: Thu, 15 May 2003 14:28:36 +0100
>Date: Tue, 13 May 2003 16:54:38 +0300
>From: Jarno.Elovirta@xxxxxxxxx
>Subject: RE: [xsl] XPath to match XML from Cocoon Request Generator


>> <page>
>>   <request xmlns="";
>>            target="/cocoon/test/request" source="">
>>     <requestHeaders>
>>   	<header name="accept">image/gif, image/jpeg, ..., */*</header> 
>>   	<header name="accept-language">en-gb</header> 
>>   	<header name="accept-encoding">gzip, deflate</header> 
>>   	<header name="user-agent">Mozilla/4.0 (compatible; MSIE 
>> 6.0; Windows
>> NT 5.0)</header> 
>>   	<header name="host">localhost:8080</header> 
>>   	<header name="connection">Keep-Alive</header> 
>>     </requestHeaders>
>>     <requestParameters /> 
>>     <configurationParameters /> 
>>   </request>
>>   <foo target="bar"/>
>> </page>
>> I what to access the target attribute of the request element. 
>>  I have used:

>  /page/x:request/@target

>where the prefix x is bound to namespace URI 

>> 1) Why is xmlns attribute causing this happening?

>See <>

>  "--except that the default namespace declared with xmlns is not used:--"


>Jarno - God Module: Illusion

Thanks for the response Jarno but I still have the problem - may be I have
misunderstood you - there is no x, so '/path/request/@target' should work:

  <request xmlns="";
           target="/cocoon/test/request" source="">

My understanding is that <xsl:value-of select="/path/request/@target"/>
should return '/cocoon/test/request', but it does not.
Instead the only XSLT I can make work is <xsl:value-of

When I remove the xmlns attribute from the XML:
  <request target="/cocoon/test/request" source="">

<xsl:value-of select="/path/request/@target"/> works.

It appears that the xmlns attribute is preventing the Xpath from matching.


 XSL-List info and archive:

Current Thread