I have troubles with xslt transformation where the original xml doesn't have escaped characters like doublequote.
I am testing with xsltproc but I didn't manage to handle proper result. I searched for a solution a lot but it seems that I cannot find the right solution for my issue. Any help would be appreciated.
Source xml:
<test>abc"abc"</test>
xslt:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:template match="/">
<test2 property="<xsl:value-of select="./test"/>" />
</xsl:template>
</xsl:stylesheet>
Result I get:
<?xml version="1.0"?>
<test2 property="abc"abc"" />
Result I need:
<?xml version="1.0"?>
<test2 property="abc"abc"" />
Verbose output:
xsltProcessOneNode: applying template '/' for /
xsltApplySequenceConstructor: copy text
<test2 property="
xsltCopyText: copy text
<test2 property="
xsltValueOf: select ./test
xsltCopyTextString: copy text abc"abc"
xsltValueOf: result 'abc"abc"'
xsltApplySequenceConstructor: copy text " />
xsltCopyText: copy text " />
freeing transformation dictionary
freeing dictionary from stylesheet
Thanks for help!
EDIT
New findings: If I add & sign, it is correctly escaped into & but " is not. I thought that it should be escaped as well, based on what I read on the internet.