[oXygen-user] Fwd:RE: [xsl] new: how to change value of attributes


Fri Nov 27 11:22:48 CST 2009


I've problems with Michael Kay suggestion:
1) Oxygen tells me to declare f: namespace and xs: namespace:
<xsl:function name="f:index-of-node" as="xs:integer*">.

2) <xsl:template match="*[. intersect $g]/@LABEL"> is open but not closed. Where can i close it? thank you so much.


> 
> An idiom I have used in such cases is:
> 
> <xsl:variable name="g" select="//mets:div[matches(@LABEL, '^Pagina
> [0-9]+$')]"/>
> 
> <xsl:template match="*[. intersect $g]/@LABEL">
>   <xsl:variable name="n" select="f:index-of-node($g, .)"/>
> 
> where
> 
> <xsl:function name="f:index-of-node" as="xs:integer*">
>   <xsl:param name="nodes" as="node()*"/>
>   <xsl:param name="node" as="node()"/>
>   <xsl:for-each select="$nodes">
>     <xsl:sequence select="position()[current() is $node]"/>
>   </xsl:for-each>
> </xsl:function>
> 
> which still isn't ideal, but it feels a bit better.
> 
> 
> Regards,
> 
> Michael Kay
> http://www.saxonica.com/
> http://twitter.com/michaelhkay 
> 
> 
> 
> 
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:>
> --~--
> 
> 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:>
--~--






More information about the oXygen-user mailing list