M
mikea_59
I am having trouble combining similar elements. Elements can be
combined if they have the same name and the same attribute values. I
can handle single level elements but am having problems with
multi-level elments (level of element nesting is unbound). I cannot
rely on fixed element names in the translator code since the translator
will be general purpose, elements names are not fixed.
Example input
<test>
<A x="0">
<B>1</B>
</A>
<A x="0">
<C>2</C>
</A>
<A x="0">
<D x="0">
<E>3</E>
</D>
</A>
<A x="0">
<D x="0">
<E>3</E>
</D>
</A>
<A x="0">
<D x="1">
<E>5</E>
</D>
</A>
<A x="1">
<B>4</B>
</A>
</test>
example output:
<test>
<A x="0">
<B>1</B>
<C>2</C>
<D x="0">
<E>3</E>
</D>
<D x="1">
<E>5</E>
</D>
</A>
<A x="1">
<B>4</B>
</A>
</test>
Any help would be greatly appreciated - still an XSL newbie
combined if they have the same name and the same attribute values. I
can handle single level elements but am having problems with
multi-level elments (level of element nesting is unbound). I cannot
rely on fixed element names in the translator code since the translator
will be general purpose, elements names are not fixed.
Example input
<test>
<A x="0">
<B>1</B>
</A>
<A x="0">
<C>2</C>
</A>
<A x="0">
<D x="0">
<E>3</E>
</D>
</A>
<A x="0">
<D x="0">
<E>3</E>
</D>
</A>
<A x="0">
<D x="1">
<E>5</E>
</D>
</A>
<A x="1">
<B>4</B>
</A>
</test>
example output:
<test>
<A x="0">
<B>1</B>
<C>2</C>
<D x="0">
<E>3</E>
</D>
<D x="1">
<E>5</E>
</D>
</A>
<A x="1">
<B>4</B>
</A>
</test>
Any help would be greatly appreciated - still an XSL newbie