XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Here is how to convert an XML document to a different encoding

Hi Roger,

> Its encoding can be changed to another encoding using this simple XSLT program:
> ---------------------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>                            version="1.0">
>
>     <xsl:output method="xml"
>                          encoding="Shift_JIS"/>
>
>     <xsl:template match="node()|@*">
>         <xsl:copy>
>             <xsl:apply-templates select="node()|@*"/>
>         </xsl:copy>
>     </xsl:template>

For what its worth, you could just do:

<xsl:template match="/">
  <xsl:copy-of select="."/>

as there is no need to process the input a node at a time.

Also, you might be interested in this post the other day about "node()
| @*" vs "@* |  node()" vs "@*, node()":

http://markmail.org/message/srnwfokgwqnsmcwx

(see Mike's reply too)



-- 
Andrew Welch
http://andrewjwelch.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS