Tuesday, March 6, 2018

XSLT




XSLT is used to transform XML documents into other XML documents  and other formats such as HTML or plain text.

XML --> other XML formats
XML --> HTML
XML --> Plain Text

the converted files subsequently converted to other formats, such as PDFPostScript and PNG.

https://www.w3schools.com/xml/xsl_intro.asp








C# code:

public static string TransformXMLToHTML(string inputXml, string xsltString)
{
    XslCompiledTransform transform = new XslCompiledTransform();
    using(XmlReader reader = XmlReader.Create(new StringReader(xsltString))) {
        transform.Load(reader);
    }
    StringWriter results = new StringWriter();
    using(XmlReader reader = XmlReader.Create(new StringReader(inputXml))) {
        transform.Transform(reader, null, results);
    }
    return results.ToString();
}

No comments:

Post a Comment

JMeter Simple Controller

  Simple Controller is just a  container  for user request.