Hi,
   you can use some XML/XSL translators to do this job. Some of these(like xslt) are just jar files , which could be called by servlets and pass these two xml,xsl documents  as arguments and they will parse-translate to html files
    bye
      ravi
 

chandra shekar wrote:

hi there,how can i call an XML file through a servlet, can anyone please let me know this asap.i am also including the code of XML file and XSL file. i know how to call this XML file thru an ASP program, but i am keen to know how a servlet can call this XML file.  This file is "pur_ord.xml" <?xml version='1.0'?>
<?xsl-stylesheet type='text/xsl' href='pur_ord.xsl'?>
<pur_ord>
 <vendor>Quantum Consultants Inc.,</vendor>
 <address>q2,Hitec city,Madhapur,Hyd</address>
 <Polines>
  <mcode>n1</mcode>
  <mdesc>nuts</mdesc>
  <qty>88</qty>
  <rate>30</rate>
 </Polines>
 <Polines>
  <mcode>b1</mcode>
  <mdesc>bolts</mdesc>
  <qty>200</qty>
  <rate>20</rate>
 </Polines>
 <Polines>
  <mcode>s1</mcode>
  <mdesc>screws</mdesc>
  <qty>900</qty>
  <rate>60</rate>
 </Polines>
</pur_ord>  This file is called "pur_ord.xsl" <?xml version = '1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/wd-xsl">
<xsl:template match="/">
<html><head><title>Quantums Purchase Order</title></head>
<body bgcolor="skyblue">
<center>
<h2><font color="red"><xsl:value-of select="pur_ord/vendor"/></font></h2>
<h3><xsl:value-of select="pur_ord/address"/></h3>
<table border="1">
<tr><th>Mcode</th><th>Mdesc</th><th>Qty</th><th>Price</th></tr>
<xsl:for-each select="pur_ord/Polines">
<tr><td><xsl:value-of select="mcode"/></td>
    <td><xsl:value-of select="mdesc"/></td>
    <td><xsl:value-of select="rate"/></td></tr>
 </xsl:for-each>
 </table></center></body></html>
 </xsl:template></xsl:stylesheet> 

Reply via email to