It seems we've found discrepancy in regex implementation during the transformation in Saxon. Consider the following xslt:
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:template match="/"> <xsl:variable name="text" as="xs:string" select="'A = "a" OR B = "b"'"/> <xsl:analyze-string regex=""(\\"|.)*?"" select="$text"> <xsl:matching-substring> <xsl:message> <xsl:sequence select="regex-group(0)"/> </xsl:message> </xsl:matching-substring> </xsl:analyze-string> </xsl:template> </xsl:stylesheet>
<html> <body> <script> var text = 'A = "a" OR B = "b"'; var regex = /"(\\"|.)*?"/; var match = text.match(regex); alert(match[0]); </script> </body> </html>
xslt produces: "a" OR B = "b"
while javascript: "a"
What is interesting is that we're certain this was working correctly in Saxon several years ago.
You can track progress of the bug at: https://saxonica.plan.io/boards/3/topics/7300 and at https://saxonica.plan.io/issues/3902.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u