Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Recursive xslt expansion

From: Hallvard B Furuseth <h.b.furuseth@----.---.-->
To: NULL
Date: 1/4/2007 11:15:00 AM

Can I have one XSLT style sheet which expands some brief XML to a longer
"normalized" form, which one of several other XSLT style sheets expands
further (or one of several parts of one sheet)?  Finally, I'll render it
with a CSS style sheet.  Or is there some other way one normally does
that?

E.g. in this xml:

<library>
  <author a_id="me" name="Myself"/>
  <series s_id="mine" name="My series">
    <by a_ref="me"/>
    <omnibus name="Foobar">
      <with>You</with>
      <novel name="Foobar #1"/>
      <novel name="Foobar #3">   <by name="Her"/> </novel>
      <novel name="Foobar #2"> <with name="Him"/> </novel>
    </omnibus>
  </series>
</library>

outer <by>s are inherited if there is no other <by> to use at a level,
while <with> adds a new <by> to the currently active <by>s.  Also, not
sure if I'll implement this but here author names not directly inside
<library> are dragged out to <library> and given an a_id.  So the above
expands to (maybe with numbered new a_ids rather than those shown here):

<library>
  <author a_id="me" name="Myself"/>
  <!-- Author IDs generated from authors without IDs: -->
  <author a_id="id_You" name="You"/>
  <author a_id="id_Her" name="Her"/>
  <author a_id="id_Him" name="Him"/>
  <series s_id="mine" name="My series">
    <by a_ref="me"/>
    <omnibus name="Foobar">
      <by a_ref="me"/>
      <by a_ref="id_You"/>
      <novel name="Foobar #1">
        <by a_ref="me"/>
	<by a_ref="id_You"/>
      </novel>
      <novel name="Foobar #3">
        <by a_ref="id_Her"/>
      </novel>
      <novel name="Foobar #2">
        <by a_ref="me"/>
	<by a_ref="id_You"/>
	<by a_ref="id_Him"/>
      </novel>
    </omnibus>
  </series>
</library>

which is then expanded further by some other sheet.

-- 
Hallvard


transparent
Print
Mail
Like It
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