tests/insn/analyze-string/analyze-string-099.xsl
changeset 1894 5aca602b9d58
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/analyze-string/analyze-string-099.xsl	Sun Sep 16 14:54:41 2018 +0100
@@ -0,0 +1,22 @@
+<xsl:stylesheet version="3.0" 
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="#all">
+ 
+ <!-- A test for non-greedy matching -->
+ 
+ <xsl:template match="/" name="xsl:initial-template">
+  <out>
+   <xsl:variable name="text" as="xs:string">'A = "a" OR B = "b"'</xsl:variable> 
+  
+  <xsl:analyze-string regex='"(%%|.)*?"' select="$text">
+   <xsl:matching-substring>
+    <match>
+     <xsl:sequence select="regex-group(0)"/>
+    </match>
+   </xsl:matching-substring>
+  </xsl:analyze-string>
+  </out>
+ </xsl:template>
+ 
+</xsl:stylesheet>
\ No newline at end of file