 |
| XML General XML discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 3rd, 2003, 06:37 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
UTF-16
I have produced a web service that extracts xml from a database and transforms is with XSLT and returns another XML document.
The only problem is that the XML file is encoded as UTF-16.
Because if this it will not open in IE.
Why would it do this?, it is even a problem?
Thanks
|
|

November 3rd, 2003, 06:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
IE should understand this type of file. It sounds like the xml declarartion has a different encoding than the one actually used. Can you say a little bit more how it is produced?
Joe (MVP - xml)
|
|

November 3rd, 2003, 09:05 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Joe,
It is the result of a transformation of data from a database (XML) and an XSLT document.
It is called via a client proxy and written to a file.
The web service called to generate the file returns a string, could this be the problem? (although it would have to return a string if the result of the transformation was not well formed anyway)
|
|

November 3rd, 2003, 09:22 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
If you are using msxml then a transformNode call generates utf-16. Can you show the start of your xslt transform?
Joe (MVP - xml)
|
|

November 3rd, 2003, 09:35 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
start of my sheet is as below:-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<AccountImport>
<xsl:for-each select="//ATTRIBUTES">
<AccountDocument>
<CompanyID><xsl:value-of select="CO_ID"></xsl:value-of></CompanyID>
|
|

November 3rd, 2003, 10:06 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
If you email the file to my hotmail address I'll have a look, chop it down to a few lines first.
--
Joe
|
|

November 3rd, 2003, 12:36 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Joe,
Before I do, I think the problem could be as discussed in the article:-
http://www.dotnet247.com/247referenc...32/161971.aspx
I am using a StringWriter Variable to hold the result of the transformation.
Apparantly these are always utf-16.....
What do you think?
|
|

November 3rd, 2003, 12:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
Yes they are, that is not the problem, IE will read utf-16 but the xml declaration might need to state the encoding as well.
--
Joe
|
|

November 4th, 2003, 06:06 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks again Joe,
Joe,
where can I get your hotmail address?
I am using:-
<xsl:output method="xml" encoding="utf-8" indent="yes"></xsl:output>
in the xslt document, it that what you were going to look for?
Thanks
|
|

November 4th, 2003, 07:12 AM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Joe,
JUST FOUND THIS!!! This has got to be the answer hasn't it? What do you think?
http://msdn.microsoft.com/library/de...ltransform.asp
My only question now is how to I set the encoding on my TextWriter object?
It's declared as follows:-
TextWriter writer = new StringWriter();
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| encoding="utf-16" Problem |
francislang |
XSLT |
7 |
April 10th, 2015 02:23 AM |
| Chapter 16 Fig 16-11 |
krsouthern |
BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 |
1 |
July 8th, 2008 12:11 PM |
| UTF-8 |
sebastian |
Classic ASP Basics |
0 |
March 16th, 2005 08:22 AM |
| How to use Scriptupload + UTF-8 ? |
duydp |
Classic ASP Professional |
1 |
October 20th, 2004 11:31 AM |
| UTF-8 msxml |
lpinho |
XML |
4 |
January 28th, 2004 06:10 AM |
|
 |