I've been given a sample XML file (ultimately my client will receive several of these each day), and an XSLT file which will apparently transform the XML into something with a meaningful layout, suitable for displaying in a browser or printing.
I'd like to put something into an existing legacy Delphi app, such that the user can pick one of the XML files from the drive and 'display' it (in a TWebBrowser or similar).
I have no idea where to start, and Googling delphi, xml and xslt gets me examples that seem to be datamodule/database based; I just want to transform a given XML file into something on-screen. It looks like it might involve a PageProducer but I can't quite get my head around what I need to do. Anyone offer any pointers, or maybe a link to a quick tutorial?
Many thanks!
Uses
XMLDoc, XMLIntf;
function Transform(XMLContent : string; XSLContent : string) : WideString;
var
XML : IXMLDocument;
XSL : IXMLDocument;
begin
XML := LoadXMLData(XMLContent);
XSL := LoadXMLData(XSLContent);
XML.DocumentElement.TransformNode(XSL.DocumentElement, Result)
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With