I'm writing a report module for this billing program and it needs to output formatted reports. I'm thinking about using XML to gather the data and pass it off to something that will make pretty HTML for me. The problem is that I've never used XML and don't know if XML to HTML is a viable option..
If anyone has experience with writing XML based reporters please drop me a note and lets discuss it!
i have experimented some good things
i'll prepare you a small example
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Apparently XSLT is an XML transformation language whose sole purpose is to translate XML into onther formats like HTML. I have been investigating this stuff lately and would love to see some support for XML and SVG in purebasic in the future as they are both open and patent free standards I believe.
<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("xmlfile.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("xslfile.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>
aXend: to better help me understand how this all works (I'm reading, but there is a lot to read!). Could you provide a quickie example of the XML that would make that XSL stylesheet spit something out?
I think I have a handle on it now.. Just going to find some external (or globally accessible) XSL translation tool and I'm GOLDEN!
[edit].. I would use javascript to render to HTML but I need access to HTML code itself to save (and email, etc).. I don't believe javascript is allowed to write files, so is there any other way to get the HTML code (perhaps from a web gadget or the like?)
I think the easiest way is to start iexplore.exe with the html file like I gave as example. In the html file you link the xmlfile to the xslfile and iexplore.exe renders the output automatically using msxml.exe. You can save the output or print the output, whatever you like.
If you have something else in mind: let me know. Good luck.