Solved

How to get the file position of a IXMLDOMNode ?

Posted on 2003-11-25
3
802 Views
Last Modified: 2011-10-03
After loading a xml file, I get a IXMLDOMNode from a Xpath with the method selectSingleNode.
How to get the corresponding file position in the XML file, and also its line number & character number ?

JPG
0
Comment
Question by:JP_Goblet
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
sparkplug earned 250 total points
ID: 9818722
The XML DOM doesn't store the file position. There is a filepos property but this only applies to parsing errors. Depending on why you need to know the file position, I guess the best solution, other then reading the XML file character by character, would be to use SAX http://msdn.microsoft.com/library/en-us/xmlsdk/htm/sax_devgd_overview_0jef.asp. The ISAXLocator interface http://msdn.microsoft.com/library/en-us/xmlsdk/htm/sax_isaxlocator_7kx1.asp provides both columnNumber and LineNumber properties.

>S'Plug<
0
 
LVL 9

Expert Comment

by:sparkplug
ID: 9819181
http://www.experts-exchange.com/help.jsp#hi73

Why the grade C? Did this not answer your question? If you needed more information you should say so. I now have a grade C against my name just for taking the time to answer your question. Thanks.

>S'Plug<
0
 

Author Comment

by:JP_Goblet
ID: 9823136
sorry i'm not familiar with experts exchange conventions, i did not think that giving a C grade was almost like a blame...
I gave a C grade because your answer did not really learn anything to me; i knew about SAX but it seems to me a very complicated solution. But perhaps there is no other way.
If there is a way i can modify the grade, let me know.

JPG
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question