views:

228

answers:

1

i am trying to traverse a node attributes ..in below xml ,i need to attach a new node in attribute value '1'or'2'matched.. how can write a code for that using MSXML property..help me i.e browse xml through attribute ...

<data>
    <menu id="**1**">
        <existes>01</existes>
    </menu>
    <menu id="**2**">
       <existes>1</existes>
       <existes>2</existes>
   </menu>
    <  menu id="**3**">
    <existes>2</existes>
   </menu>
</data>
A: 

So assuming you know how to traverse nodes over document. MSXML exposes for traverse IXMLDOMNode - you need cast it to IXMLDOMElement ( in c++ use QueryInterface in C# or VB just cast to expected interface). IXMLDOMElement - has enumerable property 'attributes' - so you can iterate all attrs of element.

Dewfy