[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Character encoding in MSXML 3.0 from VB

Subject: Character encoding in MSXML 3.0 from VB
From: Philip Fitzsimons <PFitzsimons@xxxxxxx>
Date: Mon, 8 Jan 2001 16:26:45 -0000
msxml character encoding
Hi,
	I have a rather strange problem with MSXML, given the following xml

<?xml version="1.0"?>
<mydoc>
	he said &#145;yes&#146;
</mydoc>

I should be able to extract the text, (with the quotes being open and close):
	he said 'yes'

however, MSXML insists on returning
	he said ?yes?

now this would look like a character encoding issue, apart from the fact that I don't think MSXML should be doing this, given that I have read my input file as a binary string and used loadXML i.e.
	lng_InputFile = FreeFile
	Open str_FileName For Binary Access Read As lng_InputFile
	str_XMLin = Input(FileLen(str_FileName), #lng_InputFile)
	Close #lng_InputFile
	domdoc_MyDoc.loadXML(str_XMLin)

i expect (silly me) that

	?domdoc_MyDoc.childnodes(1).childnodes(0).xml
		should output:		he said &#145;yes&#146;
	and
	?domdoc_MyDoc.childnodes(1).childnodes(0).text
		should output:		he said 'yes'

The documenation tends to suggest that &#n; are handled at load time, well whilst this is a bit odd I don't see why does it messes up the conversion? no matter what processing instruction I stick in the file it always replaces the character references with question marks rather than the quotes.

If I am really nasty and replace the &#145; in the file with the actuall charater, it works fine!

So, how do I get MSXML to load the entity &#145; and either a) leave it as &#145; or b) replace it with the correct open quote.

thoughts appreciated.

Philip.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.