clone node - xsl

Discussion in 'XML' started by ricky, May 10, 2004.

  1. ricky

    ricky Guest

    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
    ricky, May 10, 2004
    #1
    1. Advertising

  2. ricky wrote:

    > 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.
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, May 10, 2004
    #2
    1. Advertising

  3. ricky

    ricky Guest

    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

    Martin Honnen <> wrote in message news:<409f873b$>...
    > ricky wrote:
    >
    > > 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.
    ricky, May 11, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,396
  2. Replies:
    2
    Views:
    347
    Nils Bandener
    Sep 29, 2005
  3. CB
    Replies:
    1
    Views:
    585
    Johannes Koch
    Oct 2, 2003
  4. lordy

    To clone or not to clone..

    lordy, Jul 7, 2006, in forum: Java
    Replies:
    3
    Views:
    703
    lordy
    Jul 7, 2006
  5. Tjerk Wolterink
    Replies:
    2
    Views:
    1,399
    Dimitre Novatchev
    Aug 24, 2006
Loading...

Share This Page