[Progress Communities] [Progress OpenEdge ABL] Forum Post: XSLT Transforming XML to HTML .NET

  • Thread starter christian.bryan@capita.co.uk
  • Start date
Not open for further replies.


Hi All I am using the following code to transform an XML document to a HTML document using .NET classes: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DEF VAR lv-MyTransform AS System.Xml.Xsl.XslCompiledTransform NO-UNDO. DEF VAR lv-myXSLTStringReader AS System.IO.StringReader NO-UNDO. DEF VAR lv-myXMLStringReader AS System.IO.StringReader NO-UNDO. DEF VAR lv-myStringWriter AS System.IO.StringWriter NO-UNDO. DEF VAR lv-MyXMLReader AS System.Xml.XmlReader NO-UNDO. DEF VAR lv-myXMLWriter AS System.Xml.XmlWriter NO-UNDO. DEF VAR lv-XMLString AS LONGCHAR NO-UNDO. DEF VAR lv-Output AS LONGCHAR NO-UNDO. DEF VAR lv-XML-Doc AS HANDLE NO-UNDO. CREATE X-DOCUMENT lv-xml-doc. lv-xml-doc:LOAD("file", "c:\openedge\wrk\openaccess\sds_compmaint.xml", FALSE). lv-xml-doc:SAVE("LONGCHAR", lv-XMLString). lv-myXMLStringReader = NEW System.IO.StringReader(lv-xmlString). lv-MyTransform = new System.Xml.Xsl.XslCompiledTransform(). lv-Mytransform:Load("c:\openedge\wrk\custom\highways_england\ie\sds\sds_template.xsl"). lv-myStringWriter = NEW System.IO.StringWriter(). lv-MyXMLReader = System.Xml.XmlReader:CREATE(lv-myXMLStringReader). lv-MyXmlWriter = System.Xml.XmlWriter:CREATE(lv-myStringWriter, lv-Mytransform:OutputSettings). lv-Mytransform:Transform(lv-MyXMLReader,lv-myXMLWriter). lv-Output = lv-myStringWriter:ToString(). OUTPUT TO "c:\openedge\wrk\dotnet_transform.html". EXPORT lv-Output. OUTPUT CLOSE. is not escaped correctly and comes out as in the transformed HTML. E.g. Highways | Asset Details Sample XML (Please visit the site to view this file)

Continue reading...
Not open for further replies.