xsl-list
[Top] [All Lists]

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

2010-01-05 08:04:28
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--