Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > LINQ
| Search | Today's Posts | Mark Forums Read
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 May 22nd, 2009, 07:50 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default Create/Remove from existing xml

Hi,

I was wondering if you could shed some light about how use LINQ TO XML to achieve the simple task below. Is it possible?

I need to create/modify an xml document based on an existing in memory xml.

example

Suppose I have this xml in memory

<table>
<layout>
<col>1</col>
<col>2</col>
<col>3</col>
<col>4</col>
<col>5</col>
<col>6</col>
<col>7</col>
<layout>
<table>

Please not that it has 7 col elements (there could be any number of col elements).
I need to pass this xml to a function to be transformed with xlst but I have to pass only 3 col elements at a time.

So the first time I would pass the first 3 cols

<table>
<layout>
<col>1</col>
<col>2</col>
<col>3</col>
<layout>
<table>

Then the next 3

<table>
<layout>
<col>4</col>
<col>5</col>
<col>6</col>
<layout>
<table>

Then the remaining in this case only 1 col

<table>
<layout>
<col>7</col>
<layout>
<table>

Cheers

C




Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
working with existing xml using xslt bv_arvind XSLT 1 March 12th, 2007 01:37 PM
creating new xml file from existing deepee XML 1 July 25th, 2006 10:35 AM
Create new dataset from two existing datasets wmoy C# 3 June 28th, 2005 09:33 AM
Create Control in Existing Form Oleg123 Access 1 July 1st, 2004 01:24 PM





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