Re: [xsl] default namespace in match attribute of xsl:template

Subject: Re: [xsl] default namespace in match attribute of xsl:template
From: Sergey Groznyh <gsm@xxxxxx>
Date: 04 Feb 2003 11:24:15 +0300
Hello,

>>>>> "Peter" == Peter Paulus <paulus@xxxxxxxx> writes:

    Peter> The response element falls in the default namespace
    Peter> 'someuri'. How do you indicate this namespace in the match
    Peter> parameter of xsl:template. We tried match='response',
    Peter> match=':response', match='namespace::/response',
    Peter> match='#default:response'.

default namespace declarations don't apply to XPath expressions.  So
you must use some prefix to indicate namespace for element 'responce'.
Instead of

  <xsl:apply-templates select='response'/>

and

  <xsl:template match='someuri:response'>

use 

  <xsl:apply-templates select='s:response' xmlns:s='someuri'/>

and

  <xsl:template match='s:response' xmlns:s='someuri'>
    

-- 
SM Groznyh                            "Under the wide and heavy VAX
gsm@xxxxxx                             Dig my grave and let me relax..."


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread