[xsl] Character encoding in MSXML 3.0 from VB

Subject: [xsl] Character encoding in MSXML 3.0 from VB
From: Philip Fitzsimons <PFitzsimons@xxxxxxx>
Date: Mon, 8 Jan 2001 16:26:45 -0000
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