RE: Re: [xsl] xsl:analyze-string use clarification needed

Subject: RE: Re: [xsl] xsl:analyze-string use clarification needed
From: cknell@xxxxxxxxxx
Date: Tue, 23 Jan 2007 10:06:01 -0500
Thanks. I was plagiarizing from XSLT 2.0 Programmer's Reference without (mentally) parsing the code closely enough. I now have what I need.

<xsl:template match="/">
  <xsl:variable name="position-code-candidate">
   <xsl:analyze-string select="'XY02/28/2007 L'" regex="^[A-Z]+">
      <xsl:matching-substring>
        <xsl:value-of select="." />
      </xsl:matching-substring>
    </xsl:analyze-string>
  </xsl:variable>
  <xsl:value-of select="$position-code-candidate" />
</xsl:template>

--
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     David Carlisle <davidc@xxxxxxxxx>
Sent:     Tue, 23 Jan 2007 14:58:38 GMT
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Re: [xsl] xsl:analyze-string use clarification needed

<xsl:value-of select="regex-group(1)" />

group 1 is the stuff inside the first () in your regex and your regex
doesn't have a () group so this is empty, use select="."

David

Current Thread