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

embedding html tags in xsl?

Subject: embedding html tags in xsl?
From: Jerry Ventura <jventura@xxxxxxxxxx>
Date: Wed, 22 Dec 1999 10:26:52 -0500
jerry ventura
Hi all,

I've been seeing lots of examples of xsl stylesheets where html tags are
placed (hard-coded?) in the xsl style sheet. For example, I've seen:

<xsl:template match="/">
<HTML>
   <BODY BGCOLOR="#808080">
      <H1>Product List</H1>
      <B>
          <xsl:value-of select="product"/>
      </B>
   </BODY>
</HTML>
</xsl:template>

The same can also be done for components such as buttons, text area, etc. My
concern is that once html tags are introduced into a style sheet, its
flexibility has been compromised, and that xsl style sheet can only be used
to output html.

An improvement on the above might be something like:

<xsl:template match="/">
<xsl:element name="html">
   <xsl:element name="body">
            <xsl:attribute name="bgcolor">#808080<xsl:attribute/>
         <xsl:element name="h1">Product List</xsl:element>
         <xsl:element name="br">
             <xsl:value-of select="product"/>
         </xsl:element>
   </xsl:element>
</xsl:element>
</xsl:template>

While this is more of a pure xsl solution, it still requires the output
target to support an element named "html" or "body", etc. From a design
standpoint how can I not lock myself into writing an html specific
stylesheet? My understanding is that an xsl style sheet should be generic
enough to handle any output (simply change the xsl:output, right?). Are we
just not there yet? Perhaps some notion of a meta-tag that describes some
xsl elements? Do I have to wait for total support for formatting objects
before I can be this flexible?

Can anyone shed light on this? Share some opinions?

Thanks

 - Jerry


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


Current Thread

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
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.