[xsl] Matching " within a variable as:item()*

Subject: [xsl] Matching " within a variable as:item()*
From: Alex Muir <alex.g.muir@xxxxxxxxx>
Date: Tue, 5 Jan 2010 13:02:21 +0000
Hi,

In this example which is just to illustrate the problem...

I'm for some reason not able to match a string containing a " within
VariableAsItem within an analyze string method in VariableAsElement.


     <xsl:variable name="VariableAsItem" as="item()*">
        <xsl:analyze-string select="." regex="$regex" >
          <xsl:matching-substring>
            <xsl:text>"ZXZX"</xsl:text>
            <xsl:value-of select="regex-group(1)"/>
          </xsl:matching-substring>
        </xsl:analyze-string>
      </xsl:variable>


      <xsl:variable name="VariableAsElement" as="element()*">
        <xsl:for-each select="$VariableAsItem">
          <xsl:analyze-string select="." regex="&quot;ZXZX&quot;">
            <xsl:matching-substring>
              <a>
                <xsl:value-of select="position()"/>
              </a>
            </xsl:matching-substring>
          </xsl:analyze-string>
        </xsl:for-each>
      </xsl:variable>

If I match on  <xsl:analyze-string select="." regex="ZXZX'"> it
matches but if I leave the double quotes it does match. In my output I
see "ZXZX"

So is there something that prevents a match of a " within
VariableAsItem in this example?

Thanks
Alex

-- 

Alex
https://sites.google.com/a/utg.edu.gm/alex

Current Thread