This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Character encoding in MSXML 3.0 from VB


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]