Subject: Re: [xsl] how to ask analyze-string for only one match? From: Roger I Martin PhD <hypernexdev@xxxxxxxxxxxxxxx> Date: Mon, 23 Jan 2006 17:27:09 -0500 |
One way to do this is to write your analyze-string to process all the
matches, put the result in a sequence-valued variable, and select the first
item in that resulting sequence.
<xsl:variable name="s" as="xs:string*">
<xsl:analyze-string select="$d-path" regex="((\-?(\.|\d)+)(,| )+(\-?(\.|\d)+)){{1}}">
<xsl:matching-substring>
<xsl:sequence select="."/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:variable>
<xsl:analyze-string select="$s[1]">
regex="((\-?(\.|\d)+)(,| )+(\-?(\.|\d)+)){{1}}">
<xsl:matching-substring>
currentX=<xsl:value-of select="regex-group(2)"/>f;
currentY=<xsl:value-of select="regex-group(5)"/>f; </xsl:matching-substring>
</xsl:analyze-string>
Michael Kay http://www.saxonica.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to ask analyze-string, Roger I Martin PhD | Thread | [xsl] Namespace Aliasing without xs, mazerunner |
Re: [xsl] how to ask analyze-string, Roger I Martin PhD | Date | Re: [xsl] Namespace Aliasing withou, David Carlisle |
Month |