Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / April 2006

Tip: Looking for answers? Try searching our database.

2.0 : fastest read-only forward-only loading method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John A Grandy - 28 Mar 2006 22:22 GMT
In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?

For example , load the key/value pairs in the following xml doc into a
hashtable :

<Mappings>
   <Mapping MappingKey="AL" MappingValue="Alabama" />
   <Mapping MappingKey="CA" MappingValue="Alabama" />
</Mappings>
Martin Honnen - 29 Mar 2006 12:35 GMT
> In 2.0 what is the fastest way to iterate through an element set in a
> read-only forward-only XMLDocument ?

Create an XmlReader and read out the nodes you are looking for. That
assumes you have an XML document in a file or stream. If you already
have a DOM XmlDocument instance then using XPath is an option.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

John A Grandy - 19 Apr 2006 21:39 GMT
Unless your xml schema is simplistic, I think an XPathReader is typically
necessary ... no ?

>> In 2.0 what is the fastest way to iterate through an element set in a
>> read-only forward-only XMLDocument ?
>
> Create an XmlReader and read out the nodes you are looking for. That
> assumes you have an XML document in a file or stream. If you already have
> a DOM XmlDocument instance then using XPath is an option.
Martin Honnen - 20 Apr 2006 13:26 GMT
> Unless your xml schema is simplistic, I think an XPathReader is typically
> necessary ... no ?

You asked the following:

>>>In 2.0 what is the fastest way to iterate through an element set in a
>>>read-only forward-only XMLDocument ?

For read-only forward-only fastest reading an XmlReader is the tool.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

John A Grandy - 21 Apr 2006 17:35 GMT
Right, but what if the element set you wish to iterate through is buried in
a complex XML hierarchy ...

>> Unless your xml schema is simplistic, I think an XPathReader is typically
>> necessary ... no ?
[quoted text clipped - 5 lines]
>
> For read-only forward-only fastest reading an XmlReader is the tool.
Martin Honnen - 21 Apr 2006 17:46 GMT
> Right, but what if the element set you wish to iterate through is buried in
> a complex XML hierarchy ...

Well Xml(Text)Reader pulls in node by node so it is capable with dealing
with a complex XML hierarchy, you simply need to make sure your code
using the reader finds what it is looking for.
I don't think we will get far by discussing further without knowing the
XML markup you have in mind so feel free to post a URL for instance. Of
course you can use XPath if you want to, it is not that my suggestion
was meant to rule XPath out.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.