473,785 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internationaliz ation and msxml

Hello,

I have an xml retrieved by a client running Japanese windows from a server
running Japanese windows. I can view this document in IE.6. (The Opera
browser, though, reports the error.)

However, when I try to parse the xml with a sax reader I'm implementing, I
get the message "A name contained an invalid character" in the fatalError()
method of my ISAXErrorHandle r.

I built another sample app using DOM. When I try to load the file, the
Load() fails with
Exception: System.Xml.XmlE xception: The '?' character, hexadecimal value
0xFF7A,
cannot be included in a name. Line 16, position 13.
at System.Xml.XmlS canner.ScanName ()
at System.Xml.XmlS canner.ScanMark up()
at System.Xml.XmlS canner.ScanToke n(Int32 expected)
at System.Xml.XmlT extReader.SetEl ementValues()
at System.Xml.XmlT extReader.Parse Element()
at System.Xml.XmlT extReader.Read( )
at System.Xml.XmlL oader.LoadChild ren(XmlNode parent)
at System.Xml.XmlL oader.LoadEleme ntNode()
at System.Xml.XmlL oader.LoadCurre ntNode()
at System.Xml.XmlL oader.LoadChild ren(XmlNode parent)
at System.Xml.XmlL oader.LoadEleme ntNode()
at System.Xml.XmlL oader.LoadCurre ntNode()
at System.Xml.XmlL oader.LoadChild ren(XmlNode parent)
at System.Xml.XmlL oader.LoadEleme ntNode()
at System.Xml.XmlL oader.LoadCurre ntNode()
at System.Xml.XmlL oader.LoadDocSe quence(XmlDocum ent parentDoc)
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader, Boolean
prese
rveWhitespace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)

What am I overlooking in trying to read this document?

Thanks for any suggestions.

CB
Nov 12 '05 #1
9 2507
Hi Developer,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you are having trouble parsing an Xml
document both with SAX and XmlDocument. If there is any misunderstandin g,
please feel free to let me know.

Based on my research, this might be an encoding issue. Could you please let
me know, how the Xml was gained and how it was parsed? Because we need to
know the format that Xml is saved in. Have you tried to open it in IE? If
yes, can you see the encoding mode of that file? If it can be opened by IE
successfully, could you show me the code that you're using to parse the
file in .NET?

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #2
Hello, Kevin,

The client is running on Japanese Windows, connecting to a Japanese server.
Via HTTP, we prefer to use POST, but some servers only work with GET. In
either case, we write the returned stream to a file.
The header on the returned xml says it is UTF-8.
We create a SaxReader, give it a content handler and an error handler, and
call ISAXXMLReader->parseURL(filen ame). I can watch the startElement() and
endElement() methods as the file is read until the
ISAXErrorHandle r::fatalError() method is called with the error message "A
name contained an invalid character".

Internet Explorer displays the file correctly as a mix of English and
single- and multi-byte Japanese characters. However, Mozilla FireFox and
Opera 7.x browsers both indicate a problem with the xml -- "not well
formed".

The XmlDocument in my test app gives the error:
Exception: System.Xml.XmlE xception: The '?' character, hexadecimal value
0xFF7A,
cannot be included in a name. Line 15, position 15.

As for the code that parses the file, it is a simple implementation of the
ISAXXMLReader interface. In the startElement(), characters(), and
endElement() methods the code simply writes the localName or characters to
the console.

Let me know what other information you need. I would be glad to send you
the sample project(s), as well as the troublesome XML.

Thanks for your help.

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:Nq******** ******@cpmsftng xa10.phx.gbl...
Hi Developer,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you are having trouble parsing an Xml
document both with SAX and XmlDocument. If there is any misunderstandin g,
please feel free to let me know.

Based on my research, this might be an encoding issue. Could you please let me know, how the Xml was gained and how it was parsed? Because we need to
know the format that Xml is saved in. Have you tried to open it in IE? If
yes, can you see the encoding mode of that file? If it can be opened by IE
successfully, could you show me the code that you're using to parse the
file in .NET?

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #3
I was just told by one of our developers that the Java XML parsers don't
read the file, either.

"Developer" <wa******@mapin fo.nope.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hello, Kevin,

The client is running on Japanese Windows, connecting to a Japanese server. Via HTTP, we prefer to use POST, but some servers only work with GET. In
either case, we write the returned stream to a file.
The header on the returned xml says it is UTF-8.
We create a SaxReader, give it a content handler and an error handler, and
call ISAXXMLReader->parseURL(filen ame). I can watch the startElement() and endElement() methods as the file is read until the
ISAXErrorHandle r::fatalError() method is called with the error message "A
name contained an invalid character".

Internet Explorer displays the file correctly as a mix of English and
single- and multi-byte Japanese characters. However, Mozilla FireFox and
Opera 7.x browsers both indicate a problem with the xml -- "not well
formed".

The XmlDocument in my test app gives the error:
Exception: System.Xml.XmlE xception: The '?' character, hexadecimal value
0xFF7A,
cannot be included in a name. Line 15, position 15.

As for the code that parses the file, it is a simple implementation of the
ISAXXMLReader interface. In the startElement(), characters(), and
endElement() methods the code simply writes the localName or characters to
the console.

Let me know what other information you need. I would be glad to send you
the sample project(s), as well as the troublesome XML.

Thanks for your help.

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:Nq******** ******@cpmsftng xa10.phx.gbl...
Hi Developer,

First of all, I would like to confirm my understanding of your issue. From your description, I understand that you are having trouble parsing an Xml document both with SAX and XmlDocument. If there is any misunderstandin g, please feel free to let me know.

Based on my research, this might be an encoding issue. Could you please

let
me know, how the Xml was gained and how it was parsed? Because we need to know the format that Xml is saved in. Have you tried to open it in IE? If yes, can you see the encoding mode of that file? If it can be opened by IE successfully, could you show me the code that you're using to parse the
file in .NET?

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Nov 12 '05 #4
Hi Developer,

Thanks for your reply. It would be helpful if you can send me the xml file
and the code you're trying to parse it using an XmlDocument. Remove
'online' from the no spam email alias is my email address.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #5
Hi Developer,

Thanks for your Xml document. Based on my research, the Xml document
contains invalid characters. Although IE can still parse it, because IE
allows errors in the document. However, the SAX reader and XmlDocument
requires a well formed xml document. If you open the xml file in IE, you
will notice an exclamation mark with a yellow triangle in the lower-left
corner on the status bar. Double click it will show the error message.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #6
I am using IE 6, and don't see a yellow triangle in the status bar. The
status bar panels contain "Done", [blank], [blank], [blank], "My Computer".

I understand that the document contains a mix of English and Japanese
characters. The Japanese characters are a mix of different size characters,
as well.
Can you tell me what characters are invalid, and why? According to our
internationaliz ation developers, all the characters in the file are valid
Japanese, in one character set or another.

Thanks for your help.

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:yy******** ********@cpmsft ngxa06.phx.gbl. ..
Hi Developer,

Thanks for your Xml document. Based on my research, the Xml document
contains invalid characters. Although IE can still parse it, because IE
allows errors in the document. However, the SAX reader and XmlDocument
requires a well formed xml document. If you open the xml file in IE, you
will notice an exclamation mark with a yellow triangle in the lower-left
corner on the status bar. Double click it will show the error message.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #7
Any information on what characters are invalid, and why?
If msxml can't handle this document (which our engineers assure me is
well-formed and valid xml), can you suggest another parser? How does IE
display this document? Does it ignore the "invalid character" errors?
Thanks for your help.

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:yy******** ********@cpmsft ngxa06.phx.gbl. ..
Hi Developer,

Thanks for your Xml document. Based on my research, the Xml document
contains invalid characters. Although IE can still parse it, because IE
allows errors in the document. However, the SAX reader and XmlDocument
requires a well formed xml document. If you open the xml file in IE, you
will notice an exclamation mark with a yellow triangle in the lower-left
corner on the status bar. Double click it will show the error message.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #8
Hi Developer,

My Internet Explorer opens the .xml file and it shows that "Error on Page"
on the left side of the status bar. IE ignores the invalid character in the
document. Based on my research, there are more than one invalid characters
in the document, and it only returns the first invalid one which is located
at line 16, Column 18.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #9
The problematic document contained unicode characters in the "compatibil ity
area" (i.e. with character code greater than #xF900 and less than #xFFFE),
which are not allowed in XML names.
Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2029
by: Brian Kelley | last post by:
I have been using gettext and various utilities to provide internationalization for a wxPython application and have not really been liking the process. Essentially it uses a macro-style notation to indicate which strings should be internationalized. Essentially, everything looks like this _("STRING") A good description of this system is located here http://wiki.wxpython.org/index.cgi/Internationalization
6
6290
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C# extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions. I've seen examples where the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution...
3
3076
by: Daniel | last post by:
Are the differences between MSXML and .Net XSL transformation documented online anywhere? Many of my XSL's work in MSXML but transform differently in ..Net XSL transformation.
6
2797
by: Zlatko Matiæ | last post by:
What is the easiest way to accomplish internationalization in Access application?
2
1709
by: Internationalization | last post by:
COMSYS Globalization Practice is looking for a C#/.NET Internationalization consultant in OR. Can you please contact me if you are interested or else know someone who would be interested. It will be 4-6 weeks assignment. Thank you, Rhea Tanaka COMSYS Globalization Practice rtanaka@comsys.com
0
1442
by: MLH | last post by:
In the following code snippet, notice ("PIN=1234567890&MSSG=Here+is+a+short+message+-+no+spaces+-+just+plusses&Q1=0") I have it that way because I thought PLUSes were required and that spaces would not work. But I have tried ("PIN=1234567890&MSSG=Here is a short message - no spaces - just plusses&Q1=0") and the msXML.Send call works perfectly. Does anyone know how or why the PLUSes came to be used in the first place?
3
70210
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
25330
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to the version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to the latest installed version. This makes me wonder why sites like <http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to use Msxml2.XMLHTTP, first, and...
4
11826
by: mrjaxon | last post by:
I have a C# web application which leverages MSXML that I am trying to migrate to a 64 bit environment. Currently the application is built on the .NET 2.0 Framework and using MSXML 6 (though I had the same issues using version 4). The OS I am running the app on is Windows Server 2003 x64. I am using the x64 version of MSXML 6 on the server. My dev environment is Windows XP 32 bit SP2. I have tried to compile the projects for "anycpu"...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.