I have an XML file that is converted using XSL. Some elements need to be changed, some of them should be left as it is, in particular, text objects , and , and , and ;, amos , < , and should be left as it is, and in my case " and & are changed to ' and ' .
XML testing:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<element>
"
&
'
<
>
</element>
</root>
conversion file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no" />
<xsl:template match="element">
<xsl:copy>
<xsl:value-of disable-output-escaping="no" select="." />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
result:
<?xml version="1.0" encoding="UTF-8"?>
<element>
"
&
'
<
>
</element>
desired result:
<?xml version="1.0" encoding="UTF-8"?>
<element>
"
&
'
<
>
</element>
I have 2 questions:
- why are some of these objects converted and others not?
- How can I get the desired result?