Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: httpwebwitch
I have no problem of presenting the data, but I cannot find a way to store it as an html. I need what I see in the browser to be stored as html.
Thanks for all help
I am not aware of any pre-written XSLT [w3.org] scripts to do this, as your XML is probably custom XML.
If you are interested, and know how to use SourceForge Subversion [sourceforge.net], I can direct you to a project that has several XSLT [w3.org] scripts, used to transform custom XML into XHTML [w3.org], JSON [openmobilealliance.org] and WML [openmobilealliance.org] (WML 1.1 [openmobilealliance.org] and XHTML-MP 1.0 [lingvo.org]).
I have an XSL that I am using to present XML in a browser, and we have custom written it for the XML.
The problem is that the application later cannot use that XSL.
So I just want to use this XSL in order to get an HTML.
Can I build my xslt on the xsl I have?
Another guy said it should be doable justs by using the xsl.
It should be fine. I guess that you are sending the XSL to the browser, and the browser is doing the transform.
You can do the same thing on the server, as long as you have an XSLT processor that can run the stylesheet.
Sadly I'd suggest writing your own from scratch... the programming wouldn't be too difficult -
iterate through a folder's contents
read the file
transform XML>XSLT>HTML and save as...
You could build it as a server application in PHP/ASP though it may be more portable to build it as a Windows app, ie. with Visual Studio / C#
i.e. when someone asks for 12345.htm, you grab 12345.xml and transform it then output the result. one script, which handles all requests with a little rewrite rule in the .htaccess
RewriteRule (.*).htm transform.php?id=$1
then in the php...
$filename = $_GET['id'];
// load the file
// transform it
// print() the output
that's a paltry example in pseudocode, but that's the general idea
I've employed that technique to offer the same data in multiple formats, eg. "mydata.xml", "mydata.json", "mydata.html", "mydata.csv", "mydata.txt" etc - all handled by the same script, with multiple XSLT options