Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
15Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
LINQ to XML Overview

LINQ to XML Overview

Ratings: (0)|Views: 4,953|Likes:
Published by Sreenivasarao

More info:

Published by: Sreenivasarao on Aug 27, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

10/12/2012

pdf

text

original

 
Table of Contents
LINQ to XML
.NET Language Integrated Queryfor XML Data
February 2007
Copyright 
©
Microsoft Corporation 2007. All Rights Reserved.
i
 
LINQ TO XML OVERVIEW
This is a preliminary document and may be changed substantially prior to final commercial release of thesoftware described herein.The information contained in this document represents the current view of Microsoft Corporation on the issuesdiscussed as of the date of publication. Because Microsoft must respond to changing market conditions, itshould not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee theaccuracy of any information presented after the date of publication.This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS,IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rightscovering subject matter in this document. Except as expressly provided in any written license agreement fromMicrosoft, the furnishing of this document does not give you any license to these patents, trademarks,copyrights, or other intellectual property.Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos,people, places, and events depicted in examples herein are fictitious. No association with any real company,organization, product, domain name, e-mail address, logo, person, place, or event is intended or should beinferred.
©
 
2007
Microsoft Corporation. All rights reserved.
Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, Visual Studio are either registered trademarksor trademarks of Microsoft Corporation in the United States and/or other countries.All other trademarks are property of their respective owners.
ii
Copyright 
©
Microsoft Corporation 2006. All Rights Reserved.
 
Table of Contents
Table of Contents
1. Introduction......................................................................................................................................................1
1.1 Sample XML...............................................................................................................................................1
2. Programming XML with LINQ to XML .......................................................................................................3
2.1 LINQ to XML Design Principles.................................................................................................................32.1.1 Key Concepts.........................................................................................................................................32.1.1.1 Functional Construction..................................................................................................................32.1.1.2 Document "Free".............................................................................................................................52.1.1.3 XML Names....................................................................................................................................62.1.1.4 Text as value....................................................................................................................................62.2 The LINQ to XML Class Hierarchy............................................................................................................72.3 XML Names................................................................................................................................................82.3.1.1 XML Prefixes and Output.............................................................................................................102.4 Loading existing XML..............................................................................................................................112.5 Creating XML from Scratch......................................................................................................................112.6 Traversing XML .......................................................................................................................................142.6.1.1 Getting the Children of an XML Element......................................................................................142.6.1.2 Getting the Parent and Document of an XML Element.................................................................152.7 Manipulating XML....................................................................................................................................162.7.1.1 Inserting XML...............................................................................................................................162.7.2 Deleting XML......................................................................................................................................172.7.3 Updating XML.....................................................................................................................................172.7.4 Be careful with deferred query execution............................................................................................182.8 Working with Attributes............................................................................................................................192.8.1 Adding XML Attributes.......................................................................................................................192.8.2 Getting XML Attributes.......................................................................................................................192.8.3 Deleting XML Attributes.....................................................................................................................202.9 Working with other types of XML Nodes..................................................................................................202.10 Annotating nodes with user-defined information ....................................................................................202.11 Outputting XML .....................................................................................................................................212.12 Validating XML ......................................................................................................................................21
3. Querying XML with LINQ to XML.............................................................................................................22
3.1 Querying XML .........................................................................................................................................223.1.1 Standard Query Operators and XML...................................................................................................223.1.1.1 Creating multiple peer nodes in a select.......................................................................................233.1.1.2 Handling Null in a Transform........................................................................................................243.1.2 XML Query Extensions.......................................................................................................................243.1.2.1 Elements and Content....................................................................................................................253.1.2.2 Descendants and Ancestors...........................................................................................................263.1.2.3 Attributes.......................................................................................................................................263.1.2.4 ElementsBeforeSelf, ElementsAfterSelf, NodesBeforeSelf, NodesAfterSelf................................273.1.2.5 Technical Note: XML Query Extensions.......................................................................................273.1.3 XML Transformation...........................................................................................................................273.2 Using Query Expressions with XML.........................................................................................................303.3 Using XPath and XSLT with LINQ to XML.............................................................................................30
Mixing XML and other data models................................................................................................................32
3.4 Reading from a database to XML..............................................................................................................32
Copyright 
©
Microsoft Corporation 2007. All Rights Reserved.
iii

Activity (15)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
ameshlal liked this
Conspiritor liked this
chesskapil liked this
mvbalamca liked this
kennyjack liked this
Robert Durham liked this
sarav12345 liked this
M VIJAYARAJ liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->