clone node - xsl

R

ricky

i have this xml document:
<order>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
</order>

and i want with xslt transform to:

<order>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref> </ref>
<name> </name>
</item>
</order>

- i want to clone a node wanever find a occur attribute. But i want
that the rest stays intact. the occur attribute can be in a deepiest
node...and the name of the nodes can be others...

thanks in advance
ricky
 
M

Martin Honnen

ricky said:
i have this xml document:
<order>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
</order>

and i want with xslt transform to:

<order>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref>122</ref>
<name>bla bla</name>
</item>
<item occur="unbounded">
<ref> </ref>
<name> </name>
</item>
</order>

- i want to clone a node wanever find a occur attribute. But i want
that the rest stays intact. the occur attribute can be in a deepiest
node...and the name of the nodes can be others...

It is not clear to me what you want to achieve. Your input has two
<item> elements, your output three therefore I don't know which <item>
you want to be cloned.
 
R

ricky

I want to clone the last item, but with no text inside the nodes.
And the rest of the document i must retain intact

thanks!
ricky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top