xsl-list
[Top] [All Lists]

Consolidating stylesheet functionality

2006-01-23 18:55:13
I am using Kay's Modified Identity Transform Pattern to add an
attribute (@number) to certain elements (object | link). The attribute
values are unique values. The input and output are show below.

Is it possible to "capture" the result of this ID-assignment
processing and continue to manipulate the temporary tree after the new
attributes have been added, thus allowing all processing to be
captured in a single stylesheet? This seems to touch on the
functionality of xsl:function and/or xsl:import. Any references to
sections of Kay's XSLT 2.0 ed 3 would be appreciated (I'm only on page
70 of a complete read-through).

Currently, I have two xsl sheets:
java -jar saxon8.jar input.xml modifiedIdentityTransform.xsl >
input-numbered.xml
java -jar saxon8.jar input-numbered.xml myadditionalProcessing.xsl >
finally-done.xml

I would like a single xsl that consolidates the functionality of both
xsls. myAdditionalProcessing.xsl could be anything that relies on the
@number attribute on the object and link elements.

Regards,
Tim Lebo

the input and output:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <object id="a">
    <attribute name="color" value="red"/>
  </object>
  <object id="b">
     <attribute name="size" value="big"/>
  </object>
  <object id="c">
     <attribute name="size" value="small"/>
     <attribute name="color" value="purple"/>
  </object>
  <link fromobject="c" toobject="b"/>
</root>

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <object id="a" number="1">
      <attribute name="color" value="red"/>
  </object>
  <object id="b" number="2">
     <attribute name="size" value="big"/>
  </object>
  <object id="c" number="3">
     <attribute name="size" value="small"/>
     <attribute name="color" value="purple"/>
  </object>
  <link fromobject="c" toobject="b" number="4"/>
</root>[

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>