473,493 Members | 4,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Internationalization 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 ISAXErrorHandler.

I built another sample app using DOM. When I try to load the file, the
Load() fails with
Exception: System.Xml.XmlException: The '?' character, hexadecimal value
0xFF7A,
cannot be included in a name. Line 16, position 13.
at System.Xml.XmlScanner.ScanName()
at System.Xml.XmlScanner.ScanMarkup()
at System.Xml.XmlScanner.ScanToken(Int32 expected)
at System.Xml.XmlTextReader.SetElementValues()
at System.Xml.XmlTextReader.ParseElement()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
prese
rveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)

What am I overlooking in trying to read this document?

Thanks for any suggestions.

CB
Nov 12 '05 #1
9 2475
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 misunderstanding,
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(filename). I can watch the startElement() and
endElement() methods as the file is read until the
ISAXErrorHandler::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.XmlException: 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.microsoft.com> wrote in message
news:Nq**************@cpmsftngxa10.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 misunderstanding,
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******@mapinfo.nope.com> wrote in message
news:%2****************@TK2MSFTNGP09.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(filename). I can watch the startElement() and endElement() methods as the file is read until the
ISAXErrorHandler::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.XmlException: 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.microsoft.com> wrote in message
news:Nq**************@cpmsftngxa10.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 misunderstanding, 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
internationalization 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.microsoft.com> wrote in message
news:yy****************@cpmsftngxa06.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.microsoft.com> wrote in message
news:yy****************@cpmsftngxa06.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 "compatibility
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
1979
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...
6
6239
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#...
3
3040
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
2777
by: Zlatko Matić | last post by:
What is the easiest way to accomplish internationalization in Access application?
2
1684
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...
0
1419
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...
3
70127
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
25063
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...
4
11801
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...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6980
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...
0
7157
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,...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4886
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...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
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 ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.