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

RE: inheritance and encapsulation in xslt? / xslt for

Subject: RE: inheritance and encapsulation in xslt? / xslt for xlink?
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Mon, 21 Jul 2003 15:26:37 -0700
encapsula
Hi,

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
> list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Howard Stearns
> Sent: Monday, July 21, 2003 2:37 PM
> 
> So, is there a standard example or methodology for this?
> 

Perhaps I am simplifying this too much (don't see why XLink needs to be
considered), but we have a similar situation with our ASP based content
management system. We use a modified XHTML XML Schema (minus structure and
DIV/SPAN) as a base set to draw from. There is also a base set of extended
elements that we have found to be common. Then a client (well... us,
usually) can define their own elements and structure content pieces.
However, we know the namespace they will be using (you could create a simple
transform that creates the file below in the unique namespace). Since you
are using XHTML you could simply do something like:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
  version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:lsb="http://livestoryboard.com/lsb/schemas/2003/03/config" 
  xmlns:c="http://livestoryboard.com/lsb/schemas/2003/03/content" 
  exclude-result-prefixes="c lsb">

  <xsl:template match="c:*">
    <div class="{local-name()}">
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </div>
  </xsl:template>
      
</xsl:stylesheet>

This can get modified as needed, but it covers most (of our) needs. You
would then handle your unique look and feel through CSS. Of course this type
of thing just moves the problem somewhere else, but it is much easier for a
client to deal with CSS than XSL.

The above file is found in a default/common app location. We use a
URIResolver to first check a well-known client location first. If it finds
their own version of the file there the app uses it (and caches the
Template) otherwise it uses the default.

Am I being way too simplistic?

Best,
-Rob


 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.