Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Simple question to get attribute of IXMLDOMNode in using MSXML

Simple question to get attribute of IXMLDOMNode in using MSXML

Scheduled Pinned Locked Moved XML / XSL
questiontutorial
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adapterJohn
    wrote on last edited by
    #1

    Hi, I am using MSXML::IXMLDOMNode::baseName to get the name of the node. i.e., the name of the following node is "modem". 15400979 5 Does someone know how to get the attribute of this node, i.e. "1.6"? Thanks!

    M 1 Reply Last reply
    0
    • A adapterJohn

      Hi, I am using MSXML::IXMLDOMNode::baseName to get the name of the node. i.e., the name of the following node is "modem". 15400979 5 Does someone know how to get the attribute of this node, i.e. "1.6"? Thanks!

      M Offline
      M Offline
      Michael A Barnhart
      wrote on last edited by
      #2

      The node "modem" has several child nodes. One of which is the attribute node called "ID" as well as child element nodes called Number and Interval. You also has child text nodes that contain your formating text. Given that pNode is the pointer to your "modem" node. // Get Attributes IXMLDOMNamedNodeMap *AtMap; hr = pNode->get_attributes(&AtMap); long atpos,atlen; hr = AtMap->get_length(&atlen); IXMLDOMNode *item; for(atpos=0;atposget_item(atpos,&item); hr = item->get_baseName(&txt); name = txt; hr = item->get_text(&txt); data = txt; } The above code will step through all of the attribute nodes and give you their base name and text value. "I will find a new sig someday."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups