[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL

  • From: "Lars George" <lgeorge@g...>
  • To: "Anton Schoultz - ePOS" <antons@e...>,"XML-DEV LIST" <xml-dev@i...>
  • Date: Thu, 4 Nov 1999 06:34:35 +1000

RE: XSL
Hi Anton,

I do the same thing but on the server-side. Have a look at IBM's Alphaworks
site into the source of the XMLEnabler. This is a servlet that does the same
thing. It even gives you a chance to decide which XSL you use for which user
agent (browser). Therefore you can transform your data on the server and
serve it to all available browsers out there just by providing different XSL
stylesheets. I find that rather amazing, and it is simple too!

HTH,

Lars George
Woodgate Research Pty Ltd
Brisbane, Australia

> -----Original Message-----
> From: owner-xml-dev@i... [mailto:owner-xml-dev@i...]On Behalf Of
> Anton Schoultz - ePOS
> Sent: Wednesday, 3 November 1999 21:41
> To: XML-DEV LIST
> 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@e...
> Office: +27 11 807-9400 Ext. 205
>
>
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
> CD-ROM/ISBN 981-02-3594-1
> To unsubscribe, mailto:majordomo@i... the following message;
> unsubscribe xml-dev
> To subscribe to the digests, mailto:majordomo@i... the
> following message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa@i...)
>


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



  • Follow-Ups:
    • RE: XSL
      • From: Walter Underwood <wunder@i...>
    • Re: XSL
      • From: André Camenzind <andre.camenzind@a...>
  • References:
    • XSL
      • From: "Anton Schoultz - ePOS" <antons@e...>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.