RE: [xsl] Problem with simple xsl:when test expression

Subject: RE: [xsl] Problem with simple xsl:when test expression
From: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx>
Date: Tue, 3 Jul 2001 14:13:56 -0700
If your match on "xsd:simpleType" works, shouldn't your test be on
"xsd:restriction" instead of on "restriction"?


-----Original Message-----
From: Phil Mitchell [mailto:philip_mitchell@xxxxxxxxxxx]
Sent: July 3, 2001 13:10
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Problem with simple xsl:when test expression

I am trying to write a test expression for a when clause that will be true 
when the context node has a child 'restriction' element whose 'base' 
attribute is "string" -- i.e. <restriction base="string">. I think this 
clause should simply be:

	  <xsl:when test="./restriction[@base='string']">

But it doesn't seem to work -- it doesn't match. What is wrong with this? 
Here is the context node:

<simpleType name="MedlarsNameString">
   <restriction base="string">

And here is the stylesheet fragment (slightly edited -- yes, the second 
choose block is meant to be nested in an otherwise block.):

<xsl:template match="xsd:simpleType">
   <xsl:param name="elementName"/>
       <xsl:when test="@name='TextBlock'">
        Do this....
	  <xsl:when test="./restriction[@base='string']">
	  Print here.

 XSL-List info and archive:

Current Thread