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

implement attribute inheritance

Subject: implement attribute inheritance
From: Emmanouil Batsis <Emmanouil.Batsis@xxxxxxxxxxx>
Date: Tue, 13 Jul 2004 18:01:07 +0300
attribute inheritance
Dear gurus,

I'm trying to write a preprocessor script to transform implicit inheritance semantics to actual nodes. The target effect is something like namespace scopes but I want to inherit attribute-value pairs instead of namespace URIs. Then, I'll be able and edit files and assume scope based inheritance of attributes for readability and other reasons.

For example the following:

<root attr1="attr1">
  <grantparent attr2="attr2">
    <parent attr1="changed-by-parent">
      <child>
        <grandchild attr1="changed-by-grandchild"/>
      </child>
    </parent>
  </grantparent>
</root>

should become

<root attr1="attr1">
  <grantparent attr1="attr1" attr2="attr2">
    <parent attr1="changed-by-parent" attr2="attr2">
      <child attr1="changed-by-parent" attr2="attr2">
        <grandchild attr1="changed-by-grandchild" attr2="attr2"/>
      </child>
    </parent>
  </grantparent>
</root>

This of course is easy to implement for a finite number of attributes using parameters and call-template, but how can I do this when attributes are not known?

Any XSLT 1.0 pointers welcome. XSLT 2.0 pointers would be interesting, but I wont be able to use them.

Thanks,

Manos

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.