XSL in-memory adding of attribute to model XML element



Short question: is there a way to attach an attribute to the model XML tree in XSL, such that later on that attribute value can be retrieved/used?


Basically, I have a XML data-set, where I have a way of knowing that a "property" element is a leaf element, instead of having child "property" elements. For each leaf element, I call a template, by which a dot-notation full name is produced and stored as a variable. I'd like to attach that variable as an attribute to the XML data model for that element. This would allow me to do further processing, namely sorting on the attribute value. Is this possible.


For instance, if I have the following XML:



<property name="a">
<property name="z" />
<property name="w" />
<property name="b" />
<property name="c" />
<property name="b" />
</property>
</property>


I want the following output:



a.b.b
a.b.c
a.w
a.z


Any insight would be helpful. Thanks,


-D


No comments:

Post a Comment