[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 ‘yes’ </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 ‘yes’ 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 ‘ in the file with the actuall charater, it works fine! So, how do I get MSXML to load the entity ‘ and either a) leave it as ‘ or b) replace it with the correct open quote. thoughts appreciated. Philip. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|