Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scan XML Nodes for Attributes

Status
Not open for further replies.

JCScoobyRS

IS-IT--Management
Nov 20, 2002
15
US
I need to be able to scan an XML Document for Attributes that all nodes in the document have. I'll be doing this in VB. Can someone help me out? Thanks, Jeremy
 
>> scan an XML Document for Attributes

are you looking for an XPath statment like:

Code:
"//*[@myattr]"

-pete



 
Not sure but I don't think so. What I want is to take an XML Document, scan each node for attributes that all nodes have in common. Example:

<NODES>
<NODE Key=Jeremy_Test Text=Jeremy Parent=Test />
<NODE Key=Chris_Text Text=Chris Parent=Test />
<NODE Key=XML_Chris Text=XML Parent=Chris />
<NODE Key=Test Text=Test Parent=&quot;&quot; Level=0 />
</NODES>

If I scanned this, I'd get (Key,Text and Parent) as attributes that all nodes have in common. Hope this makes more sense, Jeremy
 
Jeremy, Ok now i understand.

I have never thought about that but, my first thought would be to parse the document using SAX and build the list of common attributes during the parsing.

-pete

 
Ok. Now we know it's possible but how do I do it? Can you assist me or point me to a link of any use? Thanks, Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top