Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > LINQ
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 04:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.