Results 1 to 3 of 3

Thread: VB6 - XML Attribute

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    16

    VB6 - XML Attribute

    Hi

    I have the following snippet of XML code. I need to get ahold of the attribute value for AddressStateTC. How do I do this in VB6. I know how to get a hold of all of the element values but the attribute value is eluding me.

    Thanks In Advance


    - <Address>
    <AddressKey>1</AddressKey>
    <AddressTypeCode tc="901">MAILING</AddressTypeCode>
    <Line1>1 Baghdad Road</Line1>
    <City>Paris</City>
    <AddressState>France</AddressState>
    <AddressStateTC tc="799" />

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    VB Code:
    1. dim YOURXMLDOCUMENT as MSXML2.DomDocument40
    2.  
    3. ' blah blah load your data
    4.  
    5. ' here is the tc attribute of AddressStateTC
    6. YOURXMLDOCUMENT.selectSingleNode("/Address/AddressStateTC").Attributes.getNamedItem("tc").Text

    Is this what you were looking for?
    Wydok

    "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."

    -John Von Neumann ca. 1949

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    16
    I believe so.

    Will try it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width