Updating the Document Type : XElement Update : XML LINQ C# Source Code


Custom Search

C# Source Code » XML LINQ » XElement Update »

 

Updating the Document Type








    
 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
public class MainClass {
    public static void Main() {
        XDocumentType docType;
        XDocument xDocument = new XDocument(docType = new XDocumentType("Books", null,"Books.dtd", null),
          new XElement("Books"));
        Console.WriteLine("Before updating document type:");
        Console.WriteLine(xDocument);

        docType.Name = "MyBooks";
        docType.SystemId = "http://www.yoursite.com/DTDs/MyBooks.DTD";
        docType.PublicId = "-//DTDs//TEXT Book Participants//EN";

        Console.WriteLine(xDocument);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo XML LINQ
» XElement Update