Forum Moderators: open

Message Too Old, No Replies

Applying XSL Automatically

         

tjhorne

3:18 pm on Dec 16, 2005 (gmt 0)

10+ Year Member



I have XML files that are generated automatically by a software package and I have created XSL files to style these documents.

Is it possible to apply the XSL file without having to go in and put the reference in each XML file? I didn't know if this was possible with some sort of Processor? I'd like one I can just use on my PC since I don't have a webserver to work with.

Any ideas would be really helpful, thanks in advance!

dcampbell

10:32 pm on Dec 16, 2005 (gmt 0)

10+ Year Member



You can certainly do this with PHP using code such as:

$parser = xslt_create();
$html = xslt_process($parser, $xmlfile, $xslfile);
xslt_free($parser);
echo $html;

Hope that helps.

tjhorne

2:54 pm on Dec 19, 2005 (gmt 0)

10+ Year Member



Is there a way I can do this without a Webserver? It seems this PHP code would require a Webserver with MySQL running on it, correct?

tjhorne

4:19 pm on Dec 19, 2005 (gmt 0)

10+ Year Member



I'm running PHP with Xitami locally on my PC, where would the XML files need to be placed for the metioned script above to work.

Also, in what file would I place this script? Thanks for all of your help!

tjhorne

5:15 pm on Dec 21, 2005 (gmt 0)

10+ Year Member



Since I am on a PC I have found something that will process my xml files and automatically apply my .XSLT file.

It can be dowloaded from Microsofts Website at:

[microsoft.com...]

I created a batch file on my server that will run this process automatically, let me know if you have any questions.

Thanks for all of your help.

Todd H.