Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Design of inheritance in XML and resolving it with XSLT

From: Emmanouil Batsis <Emmanouil.Batsis@----------->
To:
Date: 8/2/2006 9:01:00 AM
I did something like that in " implement attribute inheritance" thanks 
to David Carlisle's help on this list:



www.---.com



Personally i would probably go for something like



<style name="A" prop-1="x" prop-2="y" prop-3="z">
  <style name="B"  prop-1="v" prop-22="yy" prop-33="zz"/>
</style>

In other words:



* merge style and styleprops in a single element and
* use the document structure instead of the parent attribute.

This assumes you do not require multiple inheritance.



Cheers,



Manos



Svante Schubert wrote:



Hello,



Imagine you have to express an inheritance of values in XML, for
instance the overriding of style properties.

Two designs come into mind:



Design I:
  <style name="A">
      <style-props prop-1="x" prop-2="y" prop-3="z"/>
  </style>
  <style name="B" parent="A">
      <style-props prop-1="v" prop-22="yy" prop-33="zz"/>
  </style>

Design II:
  <style name="A">
      <style-props prop-1="x" prop-2="y" prop-3="z"/>
      <style name="B">
          <style-props prop-1="v" prop-22="yy" prop-33="zz"/>
      </style>
  </style>


In both design the style properties should be interpreted as:
style 'A': prop-1=x, prop-2=y, prop-3=z
style 'B': prop-1=v, prop-2=y, prop-3=z, prop-22=yy, prop-33=zz

What do you imagine is a better design?
Especially in concern of XSLT, when mapping these inherited styles to a
different style paradigm, which uses only absolute styles.

As the first labeled design is used in the implementations I work
with, let us focus on this.

How can I map it most efficiently to absolute styles?
Creating a large variable for all mapped styles right at the beginning
or map them just-in-time when found accepting redundancy in multiple
mapping of the same style?

In case the only way is the empiric approach to implement both ways and
test which is faster in an XSLT engine, any links to such performance
harness to reuse (preferable Java)?

Regards,
Svante


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent