tests/insn/analyze-string/analyze-string-099.xsl
author Michael Kay <mike@saxonica.com>
Sun, 16 Sep 2018 14:54:41 +0100
changeset 1894 5aca602b9d58
permissions -rw-r--r--
New regex test from a Saxon bug report
1894
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     1
<xsl:stylesheet version="3.0" 
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     2
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     3
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     4
 exclude-result-prefixes="#all">
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     5
 
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     6
 <!-- A test for non-greedy matching -->
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     7
 
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     8
 <xsl:template match="/" name="xsl:initial-template">
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     9
  <out>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    10
   <xsl:variable name="text" as="xs:string">'A = "a" OR B = "b"'</xsl:variable> 
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    11
  
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    12
  <xsl:analyze-string regex='"(%%|.)*?"' select="$text">
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    13
   <xsl:matching-substring>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    14
    <match>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    15
     <xsl:sequence select="regex-group(0)"/>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    16
    </match>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    17
   </xsl:matching-substring>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    18
  </xsl:analyze-string>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    19
  </out>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    20
 </xsl:template>
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    21
 
5aca602b9d58 New regex test from a Saxon bug report
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    22
</xsl:stylesheet>