regex-group() problem

M

mikea59

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?
 
M

Martin Honnen

mikea59 said:
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
 
M

mikea59

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

Thanks
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top