You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Ke...@bredex.com on 2002/06/26 20:04:36 UTC
Re: How do I...(change document encoding)
If you can't find another way, you can transform it with whatever encoding
you like using xsl:output/@encoding. There may be a more efficient way but
I know this works...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<!-- DEEP copy template -->
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:apply-templates select="/node()"/>
</xsl:template>
<xsl:template match="comment()">
<xsl:comment>
<xsl:value-of select="."/>
</xsl:comment>
</xsl:template>
<!-- this is a deep copy template copying all nodes and applying
templates to all attributes of the given node -->
<xsl:template match="*">
<xsl:element name="{name(.)}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<!-- this template copies all attributes -->
<xsl:template match="@*">
<xsl:attribute name="{name(.)}"><xsl:value-of select="."/></
xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Kevin Ross
www.bredex.com
"Mark J. Stang"
<markstang@eart To: "xindice-dev@xml.apache.org" <xi...@xml.apache.org>, "xindice-users@xml.apache.org"
hlink.net> <xi...@xml.apache.org>
cc:
06/26/2002 Subject: How do I...
08:32 AM
Please respond
to
xindice-users
Is it possible to put a document into a collection as ASCII and
to get it out as UTF-8 later?
thanks,
Mark
--
Mark J Stang
System Architect
Cybershop Systems
(See attached file: markstang.vcf)