regex-group() problem

Discussion in 'XML' started by mikea59, Jan 6, 2005.

  1. mikea59

    mikea59 Guest

    I am getting errors in XMLSpy (Pro) in the following case:

    Source Document:

    <test> 12345 AB 12345 </test>

    Stylesheet:

    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

    <xsl:template match="test">
    <xsl:analyze-string select="."
    regex=".* ([A-Z]+).*">
    <xsl:matching-substring>
    Here it is: <xsl:value-of select="regex-group(1)"/>
    </xsl:matching-substring>
    <xsl:non-matching-substring>
    Didn"t find it.
    </xsl:non-matching-substring>
    </xsl:analyze-string>
    </xsl:template>

    </xsl:stylesheet>

    XMLSpy tells me that "regex-group(1)" is not valid. Can anyone explain
    why?
    mikea59, Jan 6, 2005
    #1
    1. Advertising

  2. mikea59 wrote:

    > I am getting errors in XMLSpy (Pro) in the following case:
    >
    > Source Document:
    >
    > <test> 12345 AB 12345 </test>
    >
    > Stylesheet:
    >
    > <xsl:stylesheet version="2.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    >
    > <xsl:template match="test">
    > <xsl:analyze-string select="."
    > regex=".* ([A-Z]+).*">
    > <xsl:matching-substring>
    > Here it is: <xsl:value-of select="regex-group(1)"/>
    > </xsl:matching-substring>
    > <xsl:non-matching-substring>
    > Didn"t find it.
    > </xsl:non-matching-substring>
    > </xsl:analyze-string>
    > </xsl:template>
    >
    > </xsl:stylesheet>
    >
    > XMLSpy tells me that "regex-group(1)" is not valid. Can anyone explain
    > why?


    Does XMLSpy support XSLT 2.0? I don't know that tool.

    If it helps, I have tried your example XML and stylesheet with Saxon 8.2
    which supports XSLT 2.0 and it outputs

    Here it is: AB


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 6, 2005
    #2
    1. Advertising

  3. mikea59

    mikea59 Guest

    XMLSpy does support 2.0. I'll try going to Altova - makers of XMLSpy -
    and see if they can address the issue.

    Thanks
    mikea59, Jan 6, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    1,080
    Filip Larsen
    May 29, 2005
  2. Akaketwa
    Replies:
    1
    Views:
    4,821
    impaler
    Sep 22, 2006
  3. Replies:
    3
    Views:
    716
    Reedick, Andrew
    Jul 1, 2008
  4. christopher taylor
    Replies:
    0
    Views:
    388
    christopher taylor
    Sep 17, 2008
  5. RolfK
    Replies:
    1
    Views:
    1,830
    Martin Honnen
    Jun 7, 2009
Loading...

Share This Page