Sanje2v
26th February 2011, 23:30
Hi all,
I am having trouble with 'xsl:analyze-string'. I have the following source XML:
<AUTHOR_CONTACT_INFORMATION>Plugin author can be reached at abc@yahoo.com for his email.</AUTHOR_CONTACT_INFORMATION>
And I am using the following XSLT:
<xsl:analyze-string select="AUTHOR_CONTACT_INFORMATION" regex="(abc@yahoo.com)">
<xsl:matching-substring>
<a href="{regex-group(1)}"><xsl:value-of select="regex-group(1)" /></a>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="." />
</xsl:non-matching-substring>
</xsl:analyze-string>
The idea is to replace email addresses and web links with HTML a href. (In the above example, I've just replaced RegEx expressions to make things easier) Using Qt4's QXmlQuery class as my XSLT processor gives me empty string. Using 'Altova XMLSpy' the above correctly displays the hyperlinked output. Qt4's conformance documentation says Qt4 supports 'xsl:analyze-string'. What am I doing wrong? Are there any working examples using 'xsl:analyze-string'?
I am having trouble with 'xsl:analyze-string'. I have the following source XML:
<AUTHOR_CONTACT_INFORMATION>Plugin author can be reached at abc@yahoo.com for his email.</AUTHOR_CONTACT_INFORMATION>
And I am using the following XSLT:
<xsl:analyze-string select="AUTHOR_CONTACT_INFORMATION" regex="(abc@yahoo.com)">
<xsl:matching-substring>
<a href="{regex-group(1)}"><xsl:value-of select="regex-group(1)" /></a>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="." />
</xsl:non-matching-substring>
</xsl:analyze-string>
The idea is to replace email addresses and web links with HTML a href. (In the above example, I've just replaced RegEx expressions to make things easier) Using Qt4's QXmlQuery class as my XSLT processor gives me empty string. Using 'Altova XMLSpy' the above correctly displays the hyperlinked output. Qt4's conformance documentation says Qt4 supports 'xsl:analyze-string'. What am I doing wrong? Are there any working examples using 'xsl:analyze-string'?