XSLT 1.0 XML Data Binding  - Nuget packge LiquidTechnologies.XmlObjects.XSLT1-0 XSLT 1.0 XML Data Binding - Nuget packge LiquidTechnologies.XmlObjects.XSLT1-0

Home > XML Data Binding Nuget Packages > XSLT 1.0

 

XSL Transformations

This specification defines the syntax and semantics of the XSLT language. A transformation in the XSLT language is expressed as a well-formed XML document [XML] conforming to the Namespaces in XML Recommendation [XML Names], which may include both elements that are defined by XSLT and elements that are not defined by XSLT. XSLT-defined elements are distinguished by belonging to a specific XML namespace (see [2.1 XSLT Namespace]), which is referred to in this specification as the XSLT namespace. Thus this specification is a definition of the syntax and semantics of the XSLT namespace.

NuGet Package ID LiquidTechnologies.XmlObjects.XSLT1-0
Description An object model for the XSLT 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/xslt/1999/
Official Schema Site http://www.w3.org/TR/xslt
License EULA
Supported Platforms
  • .Net Standard 2.0 and above
  • .Net Core 2.0 and above
  • .Net Framework 4.0 and above
  • 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
*1 - If the element contains non-alphanumeric characters, then the name may be slightly different.
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. It shows how to generated the code from an XML Schema, how to deserialize an XML document and then Serialize it back out.

Try Liquid Studio and see how we can help you today Free Trial