views:

118

answers:

2

i created an xml like registry structure.. i can node traverse through node name ..here i cannot traverse a nodepath through attribute value ...i give the xml below..

 <Computer>
   <HIVE Name="HKEY_CUREENT_USER">
     <Elements>
       <element Name="(Default)" Type="REG_SZ" Data="(value not set)" /> 
       <element Name="SoftwareMicrosoftVisualStudio9.0ResourceEditorsPerformanceLoggingEnabled" Type="REG_SZ" Data="" /> 
     </Elements>
     <KEYS>
       <Key Name="Network">
         <Elements>
           <element Name="(Default)" Type="REG_SZ" Data="(value not set)" /> 
         </Elements>
       </Key>
     </KEYS>
   </HIVE>
 </Computer>

i want the path access"HKEY_CUREENT_USER\Network" ...give me a solution in c++ code(using MSXML)

+1  A: 

The XPath expression you need to access that is /Computer/HIVE/KEYS/Key[@Name='Network']

If you put this into a selectnodes statement on your DOM document then you will get a nodelist back, which you can interrogate for the information you require

Xetius
thanks a lot....
Rajakumar
+1  A: 

Load into DOM and use following method:

IXMLDOMDocument::selectSingleNode(
     L"/HIVE[@Name='HKEY_CUREENT_USER']/Key[@Name='Network']/...")
Dewfy
i can able to traverse a node now ....thanks
Rajakumar