Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

asked on

XML reporting

Hi,
Scenario.
1. I will generate/update a XML file based on an activity (sort of audit)
2. When ever I require, I would like to read this XML and generate a HTML report.
3. I have an apache server installed on one of my server, If possible I would like to use this web server to generate the report based on step 1 XML.
4. If I use XSLT, then what else I need to have on the apache server (like parser etc)
5. Wish to retreive subset of data from XML, and wish to SORT those in HTML if possible.

Please help with examples. or advise a better way. (or even any less expensive product that I can use)

Thanks in advance
Avatar of Surrano
Surrano
Flag of Hungary image

If you use XSLT simply as a stylesheet of the XML file then the transformation takes place on the client side (i.e. in the browser). Your XML should look like this: (of course names and encoding may vary)

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="somestylesheet.xsl" ?>

<somesingletag someattr="somevalue">
...
</somesingletag>

Open in new window


If you apply the XSLT on the XML in a dynamic way, e.g. within a PHP page, then it really depends on what exactly your runtime environment is. E.g. for Ubuntu + PHP, you need the php5-xsl package (and all its requirements of course). I'm a bit too lazy to dig up a self-contained PHP example though :)

(edit: examples)
Avatar of Mahesh Bhutkar
Mahesh Bhutkar

There are various libraries/open source available to transform xml using xslt on different different platform.

The simplest way where you don't even have to use any library is use Javascript to transform xml document using xslt.

Here is an example which you can refer,

http://www.w3schools.com/xsl/xsl_client.asp
http://www.w3schools.com/xsl/tryit.asp?filename=cdcatalog
ASKER CERTIFIED SOLUTION
Avatar of Surrano
Surrano
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Enthuguy, Any update on this?
Avatar of enthuguy

ASKER

.Awesome!

Thanks