Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Difference between transformNode and transformNodeToObject with respect to character encoding >Thread Next - Re: Difference between transformNode and transformNodeToObject with respect to character encoding Re: Difference between transformNode and transformNodeToObject with respect to character encodingTo: NULL Date: 1/6/2007 3:21:00 PM Pramod Subramanyan wrote: > outXMLString = inputDoc.transformNode(stylesheet) > ' Code to write outXMLString to a file Well you have not shown us the essential code at all, the stylesheet (in particular its xsl:output element that might specify an output encoding) and of course the "Code to write outXMLString to a file". In terms of Unicode characters 'µ' is _one character_ and how many _bytes_ you need to encode this in a stream/file depends on the encoding choosen, UTF-8 encodes the character with two bytes, ISO-8859-1 encodes the character with one byte. Generally with MSXML and XSLT if you want to transform to a file then it is best to use transformNodeToObject to transform to a stream like ADODB.Stream as that way MSXML makes sure to properly encode the output. Or you can, as you have done, first transform to another DOMDocument and save that with its save method. If you use transformNode to transform to a string then you have a sequence of Unicode characters as the result and your own code is then responsible to properly write that to a file, taking into account the encoding in the XML declaration. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
