[xsl] Concatenating the attribute values of ancestors

Subject: [xsl] Concatenating the attribute values of ancestors
From: "Lakshmi narayana" <lchintala@xxxxxxxxxxxx>
Date: Fri, 8 Jul 2005 12:05:05 +0500
Hi
I want a template which adds the attribute values of its ancestors and
create an attribute to the current
node. The value to this attribute is the result of conactination of all the
node values added of its parents.
For example,
<A seq="1">
	<B seq="2" />
	<C seq="3">
		<D seq="4" />
	</C>
</A>
In the above xml, I want to concatenate all the seq values of all ancestors
and its seq value also. And add new attribute
to the current node as newSeq with the result concatenated value.
Note : if seq attribute is not there concatenate value "0".
Output should look like this.
<A seq="1" newSeq="1">
	<B seq="2" newSeq="12"/>
	<C seq="3" newSeq="13">
		<D seq="4"  newSeq="134"/>
	</C>
	<E  newSeq="10">
		<F seq="5"  newSeq="105"/>
	</E>
</A>

Thanks
Laxmi Narayana

Current Thread