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

Combining stylesheets for baseclass-subclass type docu

Subject: Combining stylesheets for baseclass-subclass type documents
From: "Daniel Brockman" <daniel.brockman@xxxxxxxxxxxxxxxx>
Date: Sun, 14 Apr 2002 23:48:28 +0200
combining stylesheets
I need help designing a couple of stylesheets that both transform similar
source types; the first stylesheet transforms the base type while the
second
stylesheet transforms an extension to this type.

The first stylesheet, a.xsl, provides the a-specific information.  It has
to be
independant of the second stylesheet, b.xsl, which provides the b-specific
information.  By definition, the second stylesheet, b.xsl, cannot provide
the a-
specific information.

If the source document uses the first stylesheet, nothing special happens:

--- source 1 ---
<?xml-stylesheet type="text/xsl" href="a.xsl"?>
<a:a xmlns:a="urn:a" />

--- result 1 ---
<c:c xmlns:c="urn:c">
  <c:foo="a-specific information" />
</c:c>


If, however, it uses the second stylesheet, it gets a bit more complicated:

--- source 2 ---
<?xml-stylesheet type="text/xsl" href="b.xsl"?>
<a:a xmlns:a="urn:a" />


If the following result, result 2c, was to be generated, we could design
a.xsl
to output the a-specific information in a named template, which would be
called
from the template matching the root element in a.xsl.  This template could
then
also be called from b.xsl inside the result-element containing the
b-specific
information, <c:bar>.

--- result 2c ---
<c:c xmlns:c="urn:c">
  <c:bar="b-specific information">
    <c:foo="a-specific information" />
  </c:bar>
</c:c>


So far, so good, right?  Well, these are the problematic versions that I
want
to be able generate:

--- result 2a ---
<c:c xmlns:c="urn:c">
  <c:foo="a-specific information" />
  <c:bar="b-specific information" />
</c:c>

--- result 2b ---
<c:c xmlns:c="urn:c">
  <c:foo="a-specific information">
    <c:bar="b-specific information" />
  </c:foo>
</c:c>


I would very much appreciate any thoughts or suggestions (or indeed full
solutions) that might help me on the way.

Thanks in advance,

-
    +----+   Daniel Brockman
    | :) |   thedoc@xxxxxxxxx
    +----+   http://www.drlion.nu/

    "To spot the expert, pick the one who predicts
     the job will take the longest and cost the most."
      - Murphy


 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.