Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > LINQ
|
LINQ Discuss Microsoft's LINQ (Language INtegrated Query) for .NET 3.0 and later.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the LINQ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2010, 02:31 AM
Authorized User
 
Join Date: Jul 2007
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default Start processing a xml document from a particular node number.

Hello everyone,
there is a xml file in the following format:
Code:
<Employees>
<Employee>
<Name>Abc</Name>
<Designation>D1</Designation>
</Employee>
<Employee>
<Name>Def</Name>
<Designation>D2</Designation>
</Employee>
....
</Employees>
In the source xml the <Employee> tag might have the same name and same designation meaning an employee can be repeated in the source xml.
The application reads this xml and process each node. The source xml file and the current tag position are written to a text file (sort of maintaining a checkpoint). For some reason, if the application crashes or is closed (this is a command line application), the next time when the applicaiton is started, it will check of the checkpoint file, look for the node number and starts processing from that node (sort of resume).
Currently this is done using the normal Xml classes of dotnet and the standard for loop, with the variable i initialized to the node count from the text file.
Is there a way to use the above logic, to start processing from a particular node if we know the node number, using LINQ.

Any help is grealty appreciated.

Regards.

PS: I have not posted any code snippet as its very generic xml processing code.
 
Old March 18th, 2010, 05:59 AM
Authorized User
 
Join Date: Jul 2007
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hello everyone,
this is very trivial when I found it, should have done some lookup before posting.
Using the Skip method will allow to skip the nodes and start from the next node.

Any thanks for all the views.

Regards.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a node to an existing xml node list. codehelp C# 2008 aka C# 3.0 2 October 12th, 2009 07:41 AM
Adding a new Node to existing XML document Lupus81 XML 3 August 4th, 2009 04:57 PM
How to insert a New node into the XML Document VB jabrouni1 Classic ASP XML 1 January 26th, 2007 06:11 AM
Node Processing adamflynn XSLT 6 September 7th, 2006 05:42 AM
Processing first node in a sequence djmarquette XSLT 3 November 15th, 2005 01:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.