Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 3.5 SP1 Edition: In C# and VB by Bill Evjen, Scott Hanselman, and Devin Rader; ISBN: 9780470478264
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB 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 Search this Thread Display Modes
  #1 (permalink)  
Old December 13th, 2010, 12:32 PM
Registered User
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating XML with Linq To XML

Hello friends,
I am new to XML,so please help me out

Following is my code-->

Response.ContentType = "text/xml";

XNamespace ns = "http://example.books.com";
XDocument books = new XDocument(new XElement(ns + "bookstore",
new XElement(ns + "book",
new XAttribute("publication", "pub123"),
new XAttribute("ISBN", "123"),
new XElement(ns + "Title", "ASP.NET 4.0"),
new XElement(ns + "Price", "Rs 100"),
new XElement(ns + "Author",
new XElement(ns + "First-Name", "Anuj"),
new XElement(ns + "Last-Name", "Angural")))));


catch (Exception ex)


I am getting following error in IE--->

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


Cannot have a DOCTYPE declaration outside of a prolog. Error processing resource 'http://localhost:3018/XML/Default2.aspx'....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&...

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
chp33 LINQ query Xml Document duce1nik BOOK: Professional C# 4.0 and .NET 4 1 April 15th, 2011 10:43 AM
Creating the dtsConfig xml robhale BOOK: Microsoft SQL Server 2008 Integration Services Problem-Design-Solution 1 August 21st, 2010 11:12 PM
Reading author instances via LINQ to XML Listing10-10q workidoo BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 August 3rd, 2009 11:31 AM
Creating XML doc ; writing string(xml format) into KamalRaturi XML 5 May 28th, 2008 05:51 AM
creating a structured xml from an unstructured xml geoffgeoffgeoff XSLT 0 August 10th, 2005 02:58 PM

All times are GMT -4. The time now is 08:31 PM.

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