xsl-list
[Top] [All Lists]

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

2007-01-23 08:06:36
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(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>
Sent:     Tue, 23 Jan 2007 14:58:38 GMT
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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

--~------------------------------------------------------------------
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-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
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-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--