RE: [xsl] match string

Subject: RE: [xsl] match string
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 21 Oct 2004 13:26:11 +0100
> OK... but now the problem is, none of both seem to be valid 
> in a match pattern.

True (even in 2.0)
> 
> <xsl:template match="para(//text())[1]">    saxon says: "The only 
> functions allowed in a pattern are id() and key()"

There is no function named para(), even if general functions were allowed.

> <xsl:template match="para/descendant::text()[1]">    saxon 
> says: "Axis in pattern must be child or attribute"

Correct.
> 
> (The first one is strange: is text() really a function? And 
> even then, 
> why is "para//text()[1]" a valid pattern and 
> "para(//text())[1]" isn't?)

Because para() isn't a function.

In 2.0 you could do match="text()[. is
ancestor::para/descendant::text()[1]]".

In 1.0 you could to the same using generate-id() or count(.|x) for the
identity test.

Michael Kay
http://www.saxonica.com/ 

Current Thread