Link to home
Start Free TrialLog in
Avatar of archanamanju
archanamanju

asked on

Xml Transformation

hi,
i want to transform the xml document to html using xsl stylesheets...
but i could not get the data from xml doc properly..
pls let me know wht to be added in my code...

here is my xml dox named myxml.xml...
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="my.xsl"?>
<catalog>
<item name="Wondernut chrome" finish="chrome" locking="yes" quantity="4">
<description>Add a touch of security and style  with these lugnuts</description>
<threadsizelist>
   <threadsize>3/8-24</threadsize>
   <threadsize>7/16-20</threadsize>
   <threadsize>10mm*1.25</threadsize>
   <threadsize>12mm*1.25</threadsize>
</threadsizelist>

<wheelcompatibilty>
    <make>Aardwheels</make>
    <make>Chromeover</make>      
</wheelcompatibilty>

<wheelcompatibilty>
    <make>ZooSpokes</make>
   
</wheelcompatibilty>

<carcompatibilty make="ABC motarworks" year="all"></carcompatibilty>
<carcompatibilty mKE="yOGEU" year="1987-1988"></carcompatibilty>

<Keywordlist>
   <keyword>lugnut</keyword>
   <keyword>lug nuts</keyword>
   <keyword>siler</keyword>
   <keyword>shiny</keyword>

</Keywordlist>
<price amount="20" currency="$US" tax="0%"></price>
<shipping cost="5" currency="$US" surcharges=""></shipping>

</item>
</catalog>

And my xsl stylesheet is...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform">
<xsl:output method="xml"/>
<xsl:template match="/">

<html>
 <head><title>Lydia's Lugnuts</title></head>

<BODY>
 
 <Table border="1">
   <tr>
    <td valign="top">
           <p>Lydia's Lugnuts current offerings:</p>
      <A href="locking.html">MoreLocking Nuts</A><BR/>
      <A href="exotic.html"> exotic Nuts</A><BR/>
      <A href="basic.html">Basic Nuts</A><BR/>
   </td>

   <td>
      <xsl:for-each select="">
            <p><xsl:value-of select="."/></p>
      </xsl:for-each>
   </td>
  </tr>
</Table>


Copywright Lydia's Lugnuts

</BODY>
</html>
</xsl:template>
</xsl:stylesheet>...


pls help me how to transform the xml doc into html...
Thanks in Advance
Archana
ASKER CERTIFIED SOLUTION
Avatar of ericsDev
ericsDev

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