If you are looking for a DOM standard function of the Node or Element object there is not one. If your asking something else clarify your question. There is almost zero information in your post.
See this FAQ: faq333-3811 "Five steps to asking a question"
My apologies...I was trying to keep it simple. I believe you have already answered my question but I will elaborate in case anyone has any further ideas.
I have code that loads up an interface file from the client and converts it to XML. I have developed a web-based front end to act as a transaction viewer\editor\search engine. One interface file could contain thousands of transactions so it is necessary for the user to be able to search and the app to retrieve the specified transaction. It is also imperative that the placement of the transaction within the interface file be returned because order of processing is critical and I need to know where to begin when the user searches for the next matching transaction.
I am using SelectSingleNode to find the specified transaction but I also need to know the value of the returned node's index in respect to all other transactions(ie 31 of 5261). I was originally spinning through a "For Loop" to search but this proved inefficient on a large number of transactions.
Seems like a reasonable requirement if I follow correctly.
>> I was originally spinning through a "For Loop" to search
Yes that is the obvious approach I used to create a generic method of an Element object for reuse purposes. However you have two attributes of your project that indicate a different solution. (1) you have large thousands numbers of elements to search. (2) You are creating the XML tree!
Since your creating the XML from a proprietary data format I would consider adding unique id attributes and values to the elements you need to search at creation time. Then use that attribute to locate specific elements using XPath queries.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.