[xsl] How to get character entities out of MSXML parser - Part 2

Subject: [xsl] How to get character entities out of MSXML parser - Part 2
From: jdgarrett@xxxxxxxxxx
Date: Tue, 2 Oct 2001 12:24:21 -0500
Hi all
(yes I am back with this question for another beating...thank you very much)



given the following XML structure as XMLFile.xml

<?xml version="1.0"?>
<Company>
	<AccountNumber  Name="Ben &amp; Jerry's"
PhoneNumber="555-1212">123456</AccountNumber>
</Company>


and the following code from a visual basic project



    Function ShowXML() as string

    Dim msName As String
    Dim XMLList1 As New MSXML2.FreeThreadedDOMDocument30
    XMLList1.async = False
    XMLList1.validateOnParse = False
    XMLList1.resolveExternals = False
    XMLList1.preserveWhiteSpace = True

    Dim pbParserLoadError as Boolean
    Dim selection1 As MSXML2.IXMLDOMSelection

    pbParserLoadError = XMLList1.LoadXML(XMLFile.xml)
    Set selection1 = XMLList1.selectNodes("//AccountNumber")


1:    msName = selection1.Item(i).Attributes.getNamedItem("Name").Text

2:    selection1.Item(i).Attributes.getNamedItem("Name").Text = "Ben &amp;
Jerry's"

3:    msName = selection1.Item(i).Attributes.getNamedItem("Name").Text

    ShowXML = msName

    End Function


then the value of msName at line 1 is  displayed as     Ben & Jerry's

then the value of the attribute Name is then set to "Ben &amp: Jerry's"
at line 2 just as the original value existed in the xml structure

then the value of msName at line 3 is  displayed as     Ben &amp; Jerry's
with the ampersand as   &amp;


Since is possible to extract out the value in an untransformed state (line
3)
after it has been set in code (line 2), does anyone know how
to extract out the untransformed value after the initial load   ??

Meaning .....I need ShowXML to return "Ben &amp; Jerry's" , not "Ben &
Jerry's"

Ok let the beating begin round 2

Thanks
Jim Garrett



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


Current Thread