Hi friends,
i have a xml file whose structure is like as follows:
<ratesfound>
<rate>
<ratetype>3</ratetype>
<node1>3</node1>
<node2>3</node2>
</rate>
<rate>
<ratetype>3</ratetype>
<node1>3</node1>
<node2>3</node2>
</rate>
<rate>
<ratetype>2</ratetype>
<node1>3</node1>
<node2>3</node2>
</rate>
<rate>
<ratetype>1</ratetype>
<node1>3</node1>
<node2>3</node2>
</rate>
<rate>
<ratetype>1</ratetype>
<node1>3</node1>
<node2>3</node2>
</rate>
</ratesfound>
i want to show the three type of rates in three different tables with three different table headers.
can anyone help me?
Thanks in advance
gowni
need help on XSLT transformations
Moderator: General Moderators
-
ihateevilbill
- Forum Commoner
- Posts: 29
- Joined: Fri Nov 14, 2003 5:57 am
not sure if this is a definite answer to what ur looking for but if you check out http://www.w3schools.com/xsl/xsl_w3celementref.asp that will explain how to define XSLT. then if you go to http://www.gingerall.com/charlie/ga/xml ... .xml?s=org there are a few examples of how to use the sablotron extension in php. My advice however would be to use php to load the xml file into avariable then put something like:
which will basically concatenate the stylesheet import line with your xsl file.
Code: Select all
$xsltoutput = '<?xml-stylesheet type="text/xsl" href="yourxsl.xsl"?>' . $result;
echo $xsltoutput;which will basically concatenate the stylesheet import line with your xsl file.
-
ihateevilbill
- Forum Commoner
- Posts: 29
- Joined: Fri Nov 14, 2003 5:57 am
Of course you could also try this to attach your xsl to your xml (which is the way I was doing it before Isaw the folly of my ways
)
hope this helps
(I realise this doesnt help the XSLT question but my last answer sorts that out hopefully and this should help when you come to actually join the 2 together)
Code: Select all
<?php
$xh = xslt_create();
$res = xslt_process($xh, 'test.xml', 'test.xsl');
xslt_free($xh);
echo $res;
?>(I realise this doesnt help the XSLT question but my last answer sorts that out hopefully and this should help when you come to actually join the 2 together)
I got It
thanks Guys for your replies.
I got it.
Gowni
I got it.
Gowni