Re: Match pattern

Subject: Re: Match pattern
From: Keith Visco <kvisco@xxxxxxxxx>
Date: Thu, 21 Jan 1999 12:55:25 -0500
Oren,

Match Patterns need to be absolute, so "." won't work here. 

Try: 

<xsl:template match="*/SomeElement"> 
...
</xsl:template>

instead.

--Keith

Oren Ben-Kiki wrote:
> 
> I tried matching a node if it had at least one direct child of some type. I
> wrote:
> 
> <xsl:template match="./SomeElement">
>     ...
> </xsl:template>
> 
> But XT reported that this is not a match pattern. The WD specified that
> MatchExpr is the same as SelectExpr, and that it matches when the expression
> returns true if evaluated in the node's context; I took it to means that if:
> 
> <xsl:template match="*">
>     <xsl:if test="some-test">
>         ...
>     </xsl:if>
> </xsl:template>
> 
> works, then its OK to use "some-test" as a match pattern. For this test it
> isn't OK. Is this an XT bug or am I missing something here? Is there an
> alternative way to write the match pattern?
> 
> Have fun,
> 
>     Oren Ben-Kiki
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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


Current Thread