XSLT, moving elements

Discussion in 'Software' started by Frank Hinrichsen, Oct 24, 2012.

  1. Frank Hinrichsen

    Frank Hinrichsen

    Joined:
    Oct 24, 2012
    Messages:
    1
    Likes Received:
    0
    Here is my source,
    (note that E1EDL24 and E1EDL37 is at the same level in the structure )

    <E1EDL24 SEGMENT="1">
    <POSNR>000010</POSNR>
    ....
    <E1EDL24 SEGMENT="1">
    <POSNR>000020</POSNR>
    ...
    <E1EDL37 SEGMENT="1">
    <E1EDL44 SEGMENT="1">


    <POSNR>000010</POSNR>
    ...
    <E1EDL37 SEGMENT="1">
    <E1EDL44 SEGMENT="1">


    <POSNR>000010</POSNR>
    ....
    <E1EDL37 SEGMENT="1">
    <E1EDL44 SEGMENT="1">


    <POSNR>000020</POSNR>
    ...
    My issue is that E1EDL37 segments should be structured under E1EDL24

    E1EDL37/E1EDL44 contains the field “POSNR” which is the reference to the corresponding E1EDL24/”POSNR”

    Like moving E1EDL37 and all elements, field etc. to the corresponding E1EDL24 if/when “POSNR” matches.

    my target should look like this


    <E1EDL24 SEGMENT="1">
    <POSNR>000010</POSNR>
    .....
    <E1EDL37 SEGMENT="1">

    <E1EDL44 SEGMENT="1">
    <POSNR>000010</POSNR>

    .....
    <E1EDL37 SEGMENT="1">
    <E1EDL44 SEGMENT="1">
    <POSNR>000010</POSNR>

    .....

    <E1EDL24 SEGMENT="1">
    <POSNR>000020</POSNR>
    .....
    <E1EDL37 SEGMENT="1">
    <E1EDL44 SEGMENT="1">

    <POSNR>000020</POSNR>
    .....

    all segment before E1EDL24 must remain the same

    How to do this in XSLT. we are using version 1.0 :question:
     
    Frank Hinrichsen, Oct 24, 2012
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.