Using XPath to split a large xml file

I have a rather large (~1mb) xml file which i need to split up with an XPath Expression.  How do i make sure that the XPathNavigator doesnt traverse the entirety of the document when i send it to the xslt transform?

Ideally, i'd like to do something like:

XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator iterator = nav.Select("descendant::Contract");
while (iterator.MoveNext()){
// open a document and stuff
3/17/2005 3:44:02 PM 7181 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 34

Both the XPathNavigator and XPathDocument load the entire tree representation of your XML document in memory. This article “Best Practices for Representing XML in the .NET Framework” written by Dare Obasanjo could be of help.

In a previous project we had XML document scaling up to at least 10 megs. We accomplished an acceptable performance level by parsing the XML document through an XmlReader instance.
3/17/2005 8:00:10 PM

Similar Artilces:

Splitting XML file to different XML files
hi,I have xml file that represent a table , one of the element(column) of the xml represent category..I want to split the xml file to different xml files base on the categories (each xml file will represent different category).The question is , if it posible to split the original xml using one xslt file, or i must create different xslt file for each category?thanks in advance one xslt for each output.You can also do this with XmlDocument and save it to two seaprate paths.HTHRegards,Rob...

How to Split a XML file to multiple small XML Files
Hello, I am trying to split a XML file to multiple small xml files in and am trying to get the best possible approach to this. Any help on this will be great... Sample example on what I am trying to do... Source XML document -------------------------- <?xml version="1.0" standalone="yes"?> <SynchronizationObjectsDocument > <ApplicationArea> <DocId>dea9593b-4c60-4c1a-ab7f-004a4e336ac5</DocId> <CreationDateTime>2004-05-13T21:31:48-04:00</CreationDateTime> </ApplicationArea> &...

XML Transform to 1 XML file to another XML File
Hello All  I am a novice programmer. I want to transform 1 xml file to another xml file. I am looking for a example code where user will select source xml file and create another xml file in different file with different fields with some default validation of parsing date and default values.  Can anyone help me or let me know any available source code in C#/ASP.Net?  Ms Disha I am assuming you know xslt, if not, you would have to go look at that.  But if you do, then this document will help you out

How to write a xml file to another computer using path like this \\Server5\XML\XMLTest.xml?
Hi Guys,How can I write a xml file that read from a dataset to another computer in our network?something like this path "\\Server5\XML\XMLTest.xml"I am using below code to write xml file.----------------------------------------            // create a file name to write to.            string filename = "\\Server5\XML\XMLTest.xml";            // create the FileStream to write with.        &nb...

How to get datasource name dynamically from .txt / .xml file using 2.0 with Mysql 5.0
I am using C#.Net 2.0 With MySql 5.0. I created a project and it works fine in my machine. But problem occurs when i try to run the project other than my machine. I wrote datasource=mysystem name in connection string. Is it possible to get datasource name dynamically from a text file (*.txt) or from .xml file for MySql.Regards,Tamizhselvi  Add an App.Config file to your project and you can drop a connection string in there like so:  <connectionStrings>    <add name="PICK A NAME" connectionString="YOUR CONNECTION STRING"/>...

XML datasource from external website XML file
Hi all i need to extract some data into a page on my website, but the xml file is on different web server, not in our bunch, but out in the it possible to use this file as a datsource directly, or is there some security issue, and i have to grab it and use it locally...??? the file has been put somewhere it can be accessed with a web browseras this file changes on a daily basis, i would also like to automate the daily retrieval, i'm assuming this is something not too simple either. as you would need a service or something to fire up at a specific time each day?! any he...

write xml file using xml control
Hi Guys, Environment: 2.0   I am trying to create a xml file using xml control at rumtime. I have a asp:xml control with DocumentSource property set to xml file myFile.xml. myFile.xml: <myRoot>          <EMPLOYEE>               <FNAME></FNAME>               <LNAME></LNAME>         &nbs...

XML Creating and Parsing Very large XML Files
Hello Everyone For a long while I have used SAX for Pascal with a Delphi 6 project. it is reading and writing very large XML files (over 800MB and larger). The project has been running for years - and I recently had to upgrade to Delphi 2007 - and I discovered that SAX for Pascal has not been ported to D2007. The authors have provided full source - which I have - but now I need to get it installed into D2007. Has anyone moved the Packages over to D2007? If this is not the best way of reading and writing really large XML files anymore - any thoughts as to what is the best met...

serialize a XML file to a VB.NET file (class) using xsd
Hello   I would like to serialize  a XML file to a VB.NET  file (class).   How can I use XSD.exe  to generate my xml file  C:\leye_g\Travaux\Fichiers de données\test.xml  to a VB.NET File ?   Best regardsf Hi XML Schema Definition Tool (Xsd.exe)  can generate runtime classes from  XSD files . XmlElementAttribute Is Missing for the Generated Class Members While Using Xsd.exe describes how to generate class from xml and reports a problem. And you could find more info here: Code Generation in the .NET Framework Using XML Sch...

Help needed on XML database . How to use insert , update etc operations on XML file used as database
Hi !!! I am using an xml file as my database . But I can't  do insert , update and delete ops !!! Some one please help me ...... Pleaseeee help !!!! Its urgent .....     Maybe you need XPath, take a look at:  Welcome to my SQL/ASPNET forum for Chinese

Using XML file as a Datasource
I cannot for the life of me find a good resource or starting point for using an XML file as a datasource. Everything I have found in the last few days only give a a little bit of an answer, and so far I have been unsuccessful at piecing them all together into a solution. The XML file I am using is intended to be a reference to query and assign page properties depending on a querystring result. As a new Dot Net developer, I have been trying to find a way to do this, but I may be holding myself back with my VBScript habits. Can someone please point me the right direction to do this? He...

splitting large xml file
I have a very large (200Mb) XML file that consists of multiple records. I would like to split these records up and store the XML for each in a database for quick retrieval. I simply need to echo all of the XML between the enclosing record tags into the database. Ideally, I would use SAX to parse things, but I can't figure out how to echo the data back out exactly as I got it. Any clues? Thanks, Sean > Ideally, I would use SAX to parse things Optionally you could look at XML::RAX. Article on the RAX concept: ...

how to display item every 30 second using ajax timer and using linq to xml to query data from xml file
how to display item every 30 second using ajax timer   and using linq to xml to query data from xml file...

using xml datasource with a dynamic xml output from a website
hi guys. need help regarding this problem. we're doing a project right now that gets the latest stocks info from a website. we're passing username, password, and a year into a querystring and the website will have an xml output. the problem is that the output looks something like this : i'm wondering how i could directly use this in the xmldatasource itself. any ideas?   Hi Use HttpWebRequest and HttpWebResponse class. You can get xml string as output then you can do whatever you want(deal with xmldatasour...

Web resources about - Using XPath to split a large xml file -

Podcast 494: Error 53 is only helpful to robots
Things break. And getting something fixed instead of just tossing it is a good thing to do. But your best intentions can go awry, if, say, you ...

Obama's New Budget Makes Rubio's Point for Him
In his first two budget proposals, President Obama referred to creating a "new foundation" for the country. Read more on WeeklyStandard.

N. Korea's controversial satellite is tumbling again
CBS News N. Korea's controversial satellite is tumbling again CBS News WASHINGTON - For a moment there, it seemed like North Korea's boisterous ...

Ben Schwartz Talks About How He Helped Bring BB-8’s Voice to Life in Star Wars: The Force Awakens
Actor Ben Schwartz , known for his parts in Parks and Recreation and House of Lies , recently chatted with fans via a reddit Ask Me Anything ...

Cam Newton Had A Receiver Wide Open Before Von Miller Strip-Sacked Him
Von Miller’s strip-sack of Cam Newton with just over four minutes left to play will surely go down as the most memorable play of Super Bowl 50. ...

For Valentine's Day, here's a reminder that everyone deserves love
Love may be for everyone, but not all forms of love are fully and universally accepted. And it’s time for that to change. The hugely successful ...

Google's artificial intelligence could count as a car's driver, federal regulator says
Google Inc.'s self-driving system, controlled by artificial intelligence, could be considered a car's driver, according to the National Highway ...

Twitter’s New Feature Highlights Best Tweets First
Twitter introduced a change that is meant to combat the cacophony that characterizes — and often plagues — the micro-blogging tool platform. ...

Kanye West Declares Deals Between Kylie Jenner And Puma Dead While Kim Kardashian Talks To Top Divorce ...
Kanye West declared over Twitter that his 18 year old sister-in-law, Kylie Jenner, will not represent Puma, and that the teen is on “Yeezy team” ...

Netflix kids series 'Beat Bugs' features music of The Beatles
Amazon and Netflix are cranking out original series at a rapid pace. The content isn't just for adults, though, as both streaming libraries feature ...

Resources last updated: 2/10/2016 5:53:57 PM