egono
asked on
preserve entities
i'm using MSXML to transform some XML data to HTML
the XML contains entities like ü and others
my problem is, that after the transformations the entities
are gone (resolved and displayed as the described
character u-umlaut)
is there a way to preserve the entities or to recreate
them after the transformation?
here is some sample code (probably not working):
-------test.xml (start)-------
<?xml version="1.0" ?>
<!DOCTYPE test [
<!ENTITY % ISOlat1
PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//XML"
"http://www.icaap.org/software/ixml/ixml/ent/ISOlat1.pen">
%ISOlat1;
]>
<test>
<mytags>
<tag1>Ue - Ü</tag1>
<tag2>Ae - Ä</tag2>
<tag3>Oe - Ö</tag3>
<tag4>ue - ü</tag4>
<tag5>ae - ä</tag5>
<tag6>oe - ö</tag6>
</mytags>
</test>
-------test.xml (end)-------
-------test.xsl (start)-------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:output method="html"/>
<xsl:template match="test">
<html><body>
<xsl:apply-templates/>
</body></html>
</xsl:template>
<xsl:template match="mytags">
<p>
<xsl:value-of select="tag1"/><br/>
<xsl:value-of select="tag2"/><br/>
<xsl:value-of select="tag3"/><br/>
<xsl:value-of select="tag4"/><br/>
<xsl:value-of select="tag5"/><br/>
</p>
</xsl:template>
</xsl:stylesheet>
-------test.xsl (end)-------
the XML contains entities like ü and others
my problem is, that after the transformations the entities
are gone (resolved and displayed as the described
character u-umlaut)
is there a way to preserve the entities or to recreate
them after the transformation?
here is some sample code (probably not working):
-------test.xml (start)-------
<?xml version="1.0" ?>
<!DOCTYPE test [
<!ENTITY % ISOlat1
PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//XML"
"http://www.icaap.org/software/ixml/ixml/ent/ISOlat1.pen">
%ISOlat1;
]>
<test>
<mytags>
<tag1>Ue - Ü</tag1>
<tag2>Ae - Ä</tag2>
<tag3>Oe - Ö</tag3>
<tag4>ue - ü</tag4>
<tag5>ae - ä</tag5>
<tag6>oe - ö</tag6>
</mytags>
</test>
-------test.xml (end)-------
-------test.xsl (start)-------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:output method="html"/>
<xsl:template match="test">
<html><body>
<xsl:apply-templates/>
</body></html>
</xsl:template>
<xsl:template match="mytags">
<p>
<xsl:value-of select="tag1"/><br/>
<xsl:value-of select="tag2"/><br/>
<xsl:value-of select="tag3"/><br/>
<xsl:value-of select="tag4"/><br/>
<xsl:value-of select="tag5"/><br/>
</p>
</xsl:template>
</xsl:stylesheet>
-------test.xsl (end)-------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
my output have to be HTML with correct encoded characters,
so I need to convert the umlauts - speed doesn't matter
in this case