TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
XML question
Mar 9 2003 3:22 AM
Hi all, I have a XML document that has the following structure (example):
What I want to do is to check if a node has children or not, based on two parameters (parent node, node name). Say I call my function like this: GetNode("CPU", "INTEL"). How would I do this using the XMLDocument class/object?? Would something like this work? : private XmlNode oNode; XmlDocument oXMLDoc = new XmlDocument(); string sNodeName = "INTEL"; string sParentNode = "CPU"; FileStream oFileStream = new FileStream(FILEPATH,FileMode.Open,FileAccess.Read,FileShare.ReadWrite); oXMLDoc.Load(oFileStream); oNode = oXMLDoc.SelectSingleNode("descendant::"+ ParentNode +"["+ NodeName +" = "+ NodeName +"]"); I'm new to the whole XML thing, so excuse me if my "suggestion" is totally off! Thank you!
Reply
Answers (
4
)
Closing a Console ???
inheritance polymorphism with static members