XHTML™ 1.0 The Extensible HyperText Markup Language
XHTML is a family of current and future document types and modules that reproduce, subset, and extend HTML 4 [HTML4]. XHTML family document types are XML based, and ultimately are designed to work in conjunction with XML-based user agents. The details of this family and its evolution are discussed in more detail in [XHTMLMOD]. XHTML 1.0 (this specification) is the first document type in the XHTML family. It is a reformulation of the three HTML 4 document types as applications of XML 1.0 [XML]. It is intended to be used as a language for content that is both XML-conforming and, if some simple guidelines are followed, operates in HTML 4 conforming user agents. Developers who migrate their content to XHTML 1.0 will realize the following benefits: * XHTML documents are XML conforming. As such, they are readily viewed, edited, and validated with standard XML tools. * XHTML documents can be written to operate as well or better than they did before in existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming user agents. * XHTML documents can utilize applications (e.g. scripts and applets) that rely upon either the HTML Document Object Model or the XML Document Object Model [DOM]. * As the XHTML family evolves, documents conforming to XHTML 1.0 will be more likely to interoperate within and among various XHTML environments. The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility.
NuGet Package ID | LiquidTechnologies.XmlObjects.XHTML1-0 |
---|---|
Description | An object model for the XHTML 1.0 standard providing strongly typed classes that can be serialized/deserializsed to XML. |
Documentation | Liquid XML Objects API |
Schema Documentation | https://schemas.liquid-technologies.com/W3C/xhtml/1.0/ |
Official Schema Site | http://www.w3.org/TR/xhtml1/ |
License | EULA |
Supported Platforms |
|
- Create a new Visual Studio Project
- Add a reference to the nuget package @myModel.NugetID
-
Create an LxSerializer<> for your root element
- If the root element in your XML document is 'MyRoot' then the object generated to represent it should be called 'MyRootElm'*1
- Hint - In Visual Studio placing the caret within the code LxSerializer<MyRootElm> and pressing Alt-Shift-F10 will give you the option to add the appropriate using statement.
- Use the LxSerializer to read in the XML Document using the Deserialize method
- Setting a break point after this line will allow you to explore the structure of the object in the visual studio watch windows.
- Use the LxSerializer to write in the XML Document back out using the Serialize method
LxSerializer<ExamplePersonElm> serializer = LxSerializer<ExamplePersonElm>(); // Reading an XML file ExamplePersonElm person = serializer.Deserialize("MyPersonData.xml"); foreach(ExampleFriendElm friend in person.Friends) { Console.Write("Name = " + friend.Name); } // Edit the objects ExampleFriendElm newFriend = new ExampleFriendElm(); newFriend.Name = "Joe Blogs"; person.Friends.Add(newFriend); // Write the new data out as XML serializer.Serialize("MyNewPersonData.xml", person);
Video Tutorial
This video tutorial demonstrates the basic usage of the XML Objects tool, showing how to generate code from an XSD, read an XML document into the object model, modify the data and write out the XML.