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

Re: XSL

  • From: "G. Ken Holman" <gkholman@C...>
  • To: Dante Lee <dante@m...>, W3C XML Developers <xml-dev@i...>
  • Date: Wed, 13 Jan 1999 13:33:17 -0500

dante lee
At 99/01/13 12:00 -0500, Dante Lee wrote:
>Can anyone give me a working example of an XSL document that IE 5.0 will
>support?
>
>
>	          Dante M. Lee    Code 588
>        	NASA/GSFC Greenbelt MD 20771
> 	Voice = 301-521-1077   Bldg = 23  Rm = W415 
> 	  Email = dante@m...
>                  dante4@h...
   

This would have been better posted to:

   http://www.mulberrytech.com/xsl/xsl-list

Here is an example XSL script ... save it in a directory and name the file
"card.msxsl":

==============================8<--------------------------------
<?xml version='1.0'?>
<xsl:stylesheet
       xmlns:xsl="http://www.w3.org/TR/WD-xsl"
       xmlns="http://www.w3.org/TR/REC-html40"
       result-ns="">

<!--
PUBLIC "+//ISBN 1-894049::CSL::Demo::Card//DOCUMENT Card Stylesheet//EN"

http://www.CraneSoftwrights.com

CAVEAT - The XSL syntax used in this file follows only a working draft of
         the XSL Specification and is not necessarily representative of 
         any finalized or authorized specification.
-->

<!-- default behaviour - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template><xsl:apply-templates/></xsl:template>
<xsl:template match="textnode()"><xsl:value-of/></xsl:template>

<!-- selective behaviour - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="/">                    <!-- root rule -->
    <html>
      <head>
        <title><xsl:value-of select="/card/name"/></title>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
</xsl:template>

<xsl:template match='name'><!--process all children-->
    <h1>
      <xsl:apply-templates/> (<xsl:value-of select="/card/code"/>)</h1>
</xsl:template>

<xsl:template match="code"/><!--not processed by default-->

<xsl:template match="voice">
    <p><i><xsl:apply-templates/></i></p>
</xsl:template>

<xsl:template match="email"><!--build proper link to mail subsystem-->
    <p><a><xsl:attribute name="href">mailto:<xsl:value-of select="."
                                   /></xsl:attribute>
          <xsl:value-of select="."/></a></p>
</xsl:template>

<xsl:template match="location"><!--create a table with the info-->
    <table border="1">
      <tr><td align="center" colspan="2">
            <xsl:apply-templates select="office"/></td></tr>
      <tr>
        <td width="50%">Building: <xsl:apply-templates select="bldg"/></td>
        <td width="50%">Room: <xsl:apply-templates select="room"/></td>
      </tr>
    </table>
</xsl:template>

</xsl:stylesheet>
==============================8<--------------------------------

Here is an example XML file, save it in the same directory:

==============================8<--------------------------------
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="card.msxsl"?>
<card>
<name>Dante M. Lee</name>
<code>588</code>
<voice>301-521-1077</voice>
<location>
<office>NASA/GSFC Greenbelt MD 20771</office>
<bldg>23</bldg>
<room>W415</room>
</location>
<email>dante@m...</email>
<email>dante4@h...</email>
</card>

==============================8<--------------------------------

If you use IE5b2, then directly viewing the XML file will style it for
rendering.

I hope this helps.

...... Ken


--
G. Ken Holman         mailto:gkholman@C...
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/x/
Training:   http://www.CraneSoftwrights.com/x/schedule.htm
Resources: http://www.CraneSoftwrights.com/x/resources.htm
Shareware: http://www.CraneSoftwrights.com/x/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11

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/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


  • References:
    • XSL
      • From: Dante Lee <dante@m...>

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.