Solved

How to get the file position of a IXMLDOMNode ?

Posted on 2003-11-25
3
790 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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

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, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now