[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: XSL


Subject: Re: XSL
From: "Steve Muench" <smuench@xxxxxxxxxxxxx>
Date: Wed, 3 Nov 1999 07:42:59 -0800

See the "Oracle XSQL Servlet" on our Technet website
for a servlet that does what you're talking about.

http://technet.oracle.com/tech/xml

You can also try out Cocoon (java.apache.org)
or XT's Servlet support (www.jclark.com).

________________________________________________________
Steve Muench, BC4J Development Team & XML Evangelist
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml
----- Original Message -----
From: Anton Schoultz - ePOS <antons@xxxxxxxxxx>
To: XML-DEV LIST <xml-dev@xxxxxxxx>
Sent: Wednesday, November 03, 1999 3:41 AM
Subject: XSL


| Hi all,
| Yet another idiot question..
| I have found lots of info on XML, and lots on XSL, but very little on
| combining them!
|
| Hypothetical case; let's say that I have a servlet (eg Java) runing which
| accepts an HTTP POST/GET to query a product catalogue. The servlet queries
a
| database and then generates an XML document such as this..
|
|
| <?xml version="1.0"?>
| <!DOCTYPE ProdList SYSTEM "http://www.acme.com/dtd/ProdList.dtd">
| <ProdList>
|  <hdr date="19991201">
|   <title>Catalogue as of 1st December</title>
|  </hdr>
|  <prod code="101" short="keyboard" price="50.00">Qwerky keyboard</prod>
|  <prod code="MS1" short="Mouse" price="5.00">Mickey Mouse</prod>
|  <prod code="CRT2" short="Monitor" price="100.00">Monitor Lizard</prod>
| </ProdList>
|
|
| Let's say we have a DTD available on the web server
| "www.acme.com/dtd/ProdList.dtd"
| which looks like this..
|
| <!ELEMENT ProdList ( hdr, prod* ) >
|   <!-- header specifies effective date -->
|   <!ELEMENT hdr ( title? ) >
|   <!ATTLIST hdr
|     date CDATA #IMPLIED
|   >
|   <!ELEMENT title (#PCDATA)* >
|   <!-- each product has a code, short-descripiton and a price. -->
|   <!-- the data holds full description -->
|   <!ELEMENT prod (#PCDATA)* >
|   <!ATTLIST prod
|     code  CDATA #REQUIRED
|     short CDATA #IMPLIED
|     price CDATA #IMPLIED
|   >
| >
|
| Let's say that a style sheet is also available on www.acme... to ouput the
| catalogue as an HTML table, looks like this ... (which probably has lots
of
| errors!)
|
| <?xml version="1.0"?>
| <xsl:stylesheet xmlns:xsl="http://www.w3.org.TR/WD-xsl">
|   <xsl:template match="/">
|     <HTML>
|       <HEAD>
|         <TITLE>
|          <xsl:for-each select="hdr">
|            <xsl:value-of select="."/>
|          </xsl:for-each>
|         </TITLE>
|       </HEAD>
|       <BODY BGCOLOR="#808080">
|         <H1>Product List</H1>
|         <TABLE BORDER="1" WIDTH="400">
|           <TR>
|             <TH>Stock Code</TH>
|             <TH>Short Description</TH>
|             <TH>Long Description</TH>
|             <TH>Unit Price</TH>
|           </TR>
|           <xsl:for-each select="ProdList/prod">
|             <TR>
|               <TD> <xsl:value-of select="@code"/>  </TD>
|               <TD> <xsl:value-of select="@short"/> </TD>
|               <TD> <xsl:value-of select="."/>      </TD>
|               <TD> <xsl:value-of select="@price"/> </TD>
|             </TR>
|           </xsl:for-each>
|         </TABLE>
|       </BODY>
|     </HTML>
|   </xsl:template>
| </xsl:stylesheet>
|
|
|
| How should the servlet change it's ouput (text/xml?) so that the browser
(eg
| IE5) will pick-up the XSL and format the xml output into the desired HTML
| table ?
| What changes are required to the above files ?
|
| Regards
|
| Anton Schoultz
| e-mail: mailto:antons@xxxxxxxxxx
| Office: +27 11 807-9400 Ext. 205
|
|
| xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@xxxxxxxx
| Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
CD-ROM/ISBN 981-02-3594-1
| To unsubscribe, mailto:majordomo@xxxxxxxx the following message;
| unsubscribe xml-dev
| To subscribe to the digests, mailto:majordomo@xxxxxxxx the following
message;
| subscribe xml-dev-digest
| List coordinator, Henry Rzepa (mailto:rzepa@xxxxxxxx)
|
|


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
  • Re: XSL
    • Steve Muench - Wed, 3 Nov 1999 07:42:59 -0800 <=
Keywords