test001only Posted April 25, 2009 Report Share Posted April 25, 2009 Hi, I am using MS XML DOM ActiveX to parse through XML file I have. I want to retrieve comments from the XML document and I tried using "comment()" function along with the xPath String. It seems to be not working. Actually when I try to retrieve all the elements from an XML document, it does not get the comments at all. Any way out of this. Thanks... Quote Link to comment
candidus Posted April 25, 2009 Report Share Posted April 25, 2009 QUOTE (test001only @ Apr 24 2009, 09:21 AM) Actually when I try to retrieve all the elements from an XML document, it does not get the comments at all. Hallo, I didn't have to work with XPath for a long time but here are some hints: Comment aren't XML elements but XML nodes so try to get all nodes of the document. There is a very nice tutorial about XPath that helped me a lot. You can find it under http://www.w3schools.com/Xpath/ . You can also take a look into a (MS)XML forum, perhaps there are special issues regarding XPath and MSXML. Quote Link to comment
mje Posted April 25, 2009 Report Share Posted April 25, 2009 As candius pointed out, you're looking for nodes, not elements. Sticking with DOM methods, if you iterate over each node and compare its nodeType, you're looking for ones of the NODE_COMMENT (8) variety. If you want more than hints, show us what you have so we have a starting point. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.