Nested for-each issue [Solved]

Hi.
First of all, just started looking into xsl, so please explain things carefully.
I need to make a master-detail form, but the xml is a bit tricky.
I've made a demo here:
<DATASET>
<ROWSET1>
<ROW>
<ID>1</ID>
<NAME>Harry Potter</NAME>
</ROW>
<ROW>
<ID>2</ID>
<NAME>Draco Malfoy</NAME>
</ROW>
</ROWSET1>
<ROWSET2>
<ROW_R2>
<OWNER_ID>1</OWNER_ID>
<PC>HP</PC>
</ROW_R2>
<ROW_R2>
<OWNER_ID>1</OWNER_ID>
<PC>Dell</PC>
</ROW_R2>
<ROW_R2>
<OWNER_ID>2</OWNER_ID>
<PC>Compaq</PC>
</ROW_R2>
</ROWSET2>
</DATASET>
Here's what I want printed:
Harry Potter
-HP
-Dell
Draco Malfoy
-Compaq
Here's how I've tried making my xsl and if's for joining.
<xsl:for-each select="DATASET/ROWSET1/ROW">
<xsl:value-of select="NAME"/>
<xsl:for-each select="../../ROWSET2/ROW_R2">
<xsl:if test=" ../../ROWSET1/ROW/ID = OWNER_ID">
<xsl:text>ID: </xsl:text><xsl:value-of select="../../ROWSET1/ROW/ID"/>
<xsl:text>OWNER_ID: </xsl:text><xsl:value-of select="OWNER_ID"/>
<xsl:text>PC: </xsl:text><xsl:value-of select="PC"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
This only outputs
Harry Potter
Draco Malfoy
If I remove the if/end if, it outputs
Harry Potter
ID:1 Owner_ID:1 PC:HP
ID:1 Owner_ID:1 PC:Dell
ID:1 Owner_ID:2 PC:Compaq
Draco Malfoy
ID:1 Owner_ID:1 PC:HP
ID:1 Owner_ID:1 PC:Dell
ID:1 Owner_ID:2 PC:Compaq
Obviously there's a couple of things wrong, so if anyone could help out I'd be greatful.
I know it's a bit tacky looping through twice to find matching id vs owner_id, but with this kind of xml I don't know any other way, and I can't change the xml. Fortunately it's not that much data so it shouldn't be too slow.
Cheers,
Vidar
Message was edited by:
Vidar
:added solved to subject

A solution that works is to great a for-each loop table using ROWSET1 and setting a variable to the ID value. Then put a nested for-each loop inside the first using ROWSET2 and using a filter on the for-each to filter for OWNER_ID like this:
<?for-each:/DATASET/ROWSET2/ROW_R2[xdoxslt:get_variable($_XDOCTX, 'x')=OWNER_ID]?>
for template then looks like the following:
inialize variable 'x'
for-each ROWSET1
NAME
ID set 'x'
for-each ROWSET2[filter]
OWNER ID PC
end for-each
end for-each

Similar Messages

  • Nested for-each not working

    Hello all. I am studying XSLT in school and need some help.
    Display the following: Software titles for each operating system sorted by category. Sorting is not the problem. I am having an issue with displaying software titles for each operating system. Here is the XML and the XSLT.
    <?xml version="1.0"?>
    <!-- Note: For many of the wonders, the experts do not agree on precise dates or construction dimensions. In these cases, I chose a year or dimension in the middle of the range so all attributes could be numeric. -->
    <software_inventory>
    <software xmlns:xsi="Software.xsd">
    <title>Adobe Photoshop</title>
    <vendor>Adobe</vendor>
    <category>Graphics</category>
    <support_platforms>
    <Platform>Windows 7</Platform>
    <Platform>Windows 8</Platform>
    <Platform>Windows 8.1</Platform>
    </support_platforms>
    <Approved_Versions>
    <Version Hardware_Requirements="4GB Ram 2GB Hard Drive" Software_Requiremnts="32/64 bit" Price="399">CS 5.5</Version>
    </Approved_Versions>
    </software>
    <software>
    <title>Winzip</title>
    <vendor>Winzip International</vendor>
    <category>Utility</category>
    <support_platforms>
    <platform>Windows Vista</platform>
    <platform>Windows 7</platform>
    <platform>Windows 8</platform>
    <platform>Windows 8.1</platform>
    </support_platforms>
    <Approved_Versions>
    <Version Hardware_Requirements="2GB Ram 250MB Hard Drive" Software_Requiremnts="32/64 bit" Price="29.99">19</Version>
    </Approved_Versions>
    </software>
    There are more titles in the XML, but I didn't include them.
    Here is the XSLT
    <h1>Software Titles for each operating system, sorted by category</h1>
    <table border="1">
    <tr>
    <th>Software Title</th>
    <th>Operating System</th>
    <th>Category</th>
    </tr>
    <xsl:for-each select="software_inventory/software">
    <xsl:sort select="support_platforms/platform"/>
    <xsl:sort select="category"/>
    <tr>
    <td>
    <xsl:value-of select="title"/>
    </td>
    <td>
    <xsl:for-each select="support_platforms/platform">
    <xsl:value-of select="platform"/>
    <xsl:text>&#13;</xsl:text>
    </xsl:for-each>
    </td>
    <td>
    <xsl:value-of select="category"/>
    </td>
    </tr>
    </xsl:for-each>
    </table>
    Here is a screen shot of the output. What I would like is for each Platform / operating system to show in the same cell, so the adjacent cells will grow taller to accommodate. 
    What am I doing wrong?

    You cannot ask for "platform" when your pointer is already pointing at "platform".
    Also your input XML is inconsistent concerning capitalized and not capitalized "platform/Platform".
    Under the assumption that platform should always be "platform", try replacing:
    <td>
    <xsl:for-each select="support_platforms/platform">
    <xsl:value-of select="platform"/>
    <xsl:text>&#13;</xsl:text>
    </xsl:for-each>
    </td>
    With:
    <td>
    <xsl:for-each select="support_platforms/platform">
    <xsl:value-of select="."/>
    <xsl:text>&#13;</xsl:text>
    </xsl:for-each>
    </td>
    Morten la Cour

  • XSLT For-Each Issue, how to traverse back to previous node

    How to get the SupplierName(Primary) from the below payload
    *+<ItemSupplier>+*
    +<SupplierParty>+
    +<SupplierName>SUPPLIER NAME 1</SupplierName>+
    +</SupplierParty>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    +<ItemSupplierLocation>+
    +<Status>2</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    *+</ItemSupplier>+*
    *+<ItemSupplier>+*
    +<SupplierParty>+
    *+<SupplierName>SUPPLIER NAME 2</SupplierName>+*
    +</SupplierParty>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>Y</PriorityCode>+
    +</ItemSupplierLocation>+
    *+</ItemSupplier>+*
    The condition i need to run is as below, but as the control will be inside the <ItemSupplierLocation> how do i go back to previous node and get the value of supplier name.
    +<ItemSupplier> can be n number+
    <xsl:for-each select="ItemSupplier/ItemSupplierLocation">
    <xsl:choose>
    <xsl:when test='PriorityCode="Y" and Status="1"'>
    <Supplier>
    <xsl:value-of select="ItemSupplier/SupplierName"/>
    </Supplier>
    </xsl:when>
    </xsl:choose>
    </xsl:for-each>
    Thanks,
    Vijay

    Fixed the issue with the below code
    <xsl:for-each select="ItemSupplier/ItemSupplierLocation">
    <xsl:choose>
    <xsl:when test='PriorityCode="Y" and Status="1"'>
    <Supplier>
    <xsl:value-of select="../SupplierParty/SupplierName"/>
    </Supplier>
    </xsl:when>
    </xsl:choose>
    </xsl:for-each>
    Thanks,
    Vijay

  • [sound] Select audio canal for each application [solved]

    Hi all
    After a long and unsuccessful search on the net I decide to post my question here.
    I have a motherboard with the HDA chipset (4 output in the back) and I want to choose for each application the output.
    For example : my music on the Master output (plugged to amp),  my video on the Suround output (plugged to a helmet), all the other apps on the Side output (plugged to speakers) ...
    I am actually whith ALSA and Pulseaudio, but I am ready to change all to do that (except the ditrib )
    Thanks in advance
    (sorry if my english is poor, I am french)
    Last edited by sauliwx (2014-09-12 13:43:09)

     My bad, clipboard must have been turned off or I simply confused the links. Here the correct one, once again. Runtime arguments allow you to specify a pcm with parameters set upon execution:
    speaker-test -c 2 -t wav -D plug:"dmix:{CARD DG DEV 0}"
    # CARD D is one argument and DEV 0 the other. The original dmix takes more arguments
    # see /usr/share/alsa/pcm/dmix.conf
    # The one I proposed takes also channels number as runtime argument like so
    speaker-test -c 8 -t wav -D plug:"dmix:{CARD SB DEV 0 SUBDEV -1 FORMAT S32_LE RATE 192000 CHANNELS 8}"
     The more important thing is dsnoop, otherwise you might have problems when recording. This kind of configuration may end up similar to this proposed one. Similar when it comes to logical structure that is. You might want to try build your configuration into the latter one. Instead of this:
    default {
    # use pulse as default
    type pulse
    fallback "sysdefault"
    hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
     try this based on your part:
    default {
    type asym;
    playback.pcm "green";
    capture.pcm "dsnoop1";
    fallback "sysdefault"
    hint {
    show on
    description "Default ALSA Output (currently green)"
     You had no asym type plugin in there.
    Edit: "fallback" might not only be unnecessary, it might conflict or cause an error within the configuration. Untested.
    Last edited by emeres (2014-09-17 16:13:40)

  • Need to access parent elements in nested for-each loop

    Hi All,
    I have a xslt mapping requirement in which I am completely stuck. The details are as listed below. Please help!
    Schema structure is as follows:
    Root
    Payload
    Transaction-123
    Loop-LINE
    Loop-SDPP
    Segment-FSTT
    Element-111
    Required xslt file structure is:
    <xsl:for-each Loop-LINE>
    <tns:Item>
    <Line-1000>
    <Line-2000>
    <Line-3000>
    <Line-8000>
    <xsl:for-each Loop-SDPP>
    <xsl:for-each Segment-FSTT[ns0:Element-111 != "A"]>
    <SDetails>
    </SDetails>
    <xsl:for-each Loop-LINE> --------- How to access Loop-LINE element from this for loop????
    <tns:Item>
    <2000>
    <2020>
    <2070>
    <2150>
    </tns:Item>
    </xsl:for-each>
    </for-each>
    </for-each>
    </tns:item>
    </for-each>
    Need help in understanding how can I run a for-each loop for Loop-LINE which is two levels up in the schema tree structure.
    Thanks..

    Thanks for this answer but I can't obtain the right output with my test case; the multi column must be in the loop as that :
    ALPHABETICAL INDEX C1
    Alternator .......................................... Feed Pump
    Belt Details / Engine Gaskets Sets ..... Flywheel Housing
    < NEW PAGE>
    INDEX ALPHABETIQUE C2
    Alternateur......................................... Culbuteurs
    Bloc-Cylindres.................................... Demarreur
    Denis

  • Force fsck on boot and timeout waiting for device issues [SOLVED]

    Archlinux starts checking fs on every boot since linux and systemd packages were updated last night.
    systemd --->213-5
    linux ---->3.14.5-1
    Another issue appears with last update
    Timed out waiting for device dev-disk-by\x2duuid-9f780ada\x2d0671\
    Dependency failed for /dev/disk/by-uuid/9f780ada-0671-43d8-b036-f9
    Dependency failed for Swap.
    I have this issue on my laptop which was updated yesterday.I have also desktop running archlinux again I've just checked out the systemd and linux versions.The systemd package is not the latest one it's 212-3.I havent any problem on that machine.I guess systemd is responsible of this cause.
    I've just reboot and realized that systemd-fsck says Super block last write is in the future.Date and time is correct in BIOS same as on linux
    Last edited by gecici90 (2014-06-05 21:10:52)

    I had the same problem, I get in the recovery console after forced fsck.
    But downgrading systemd and systemd-sysvcompat to their previous version made it all work back again.
    The sorted list of the upgraded packages:
    [2014-06-05 21:11] [PACMAN] installed libx264 (1:142.20140311-4)
    [2014-06-05 21:11] [PACMAN] upgraded btrfs-progs (3.14.1-1 -> 3.14.2-2)
    [2014-06-05 21:11] [PACMAN] upgraded cifs-utils (6.2-1 -> 6.3-1)
    [2014-06-05 21:11] [PACMAN] upgraded imagemagick (6.8.9.1-2 -> 6.8.9.1-3)
    [2014-06-05 21:11] [PACMAN] upgraded filesystem (2013.05-2 -> 2014.05-2)
    [2014-06-05 21:11] [PACMAN] upgraded lib32-libdbus (1.8.0-1 -> 1.8.2-1)
    [2014-06-05 21:11] [PACMAN] upgraded libproxy (0.4.11-2 -> 0.4.11-3)
    [2014-06-05 21:11] [PACMAN] upgraded libpurple (2.10.9-1 -> 2.10.9-2)
    [2014-06-05 21:11] [PACMAN] upgraded libsystemd (212-3 -> 213-5)
    [2014-06-05 21:11] [PACMAN] upgraded libwbclient (4.1.7-1 -> 4.1.8-1)
    [2014-06-05 21:11] [PACMAN] upgraded openssl (1.0.1.g-1 -> 1.0.1.h-1)
    [2014-06-05 21:11] [PACMAN] upgraded perl (5.18.2-2 -> 5.20.0-2)
    [2014-06-05 21:11] [PACMAN] upgraded perl-xml-parser (2.41-4 -> 2.41-5)
    [2014-06-05 21:11] [PACMAN] upgraded perl-yaml-syck (1.27-1 -> 1.27-2)
    [2014-06-05 21:11] [PACMAN] upgraded pidgin (2.10.9-1 -> 2.10.9-2)
    [2014-06-05 21:11] [PACMAN] upgraded postgresql-libs (9.3.4-1 -> 9.3.4-2)
    [2014-06-05 21:11] [PACMAN] upgraded python2 (2.7.6-3 -> 2.7.7-1)
    [2014-06-05 21:11] [PACMAN] upgraded smbclient (4.1.7-1 -> 4.1.8-1)
    [2014-06-05 21:11] [PACMAN] upgraded subversion (1.8.9-1 -> 1.8.9-2)
    [2014-06-05 21:11] [PACMAN] upgraded systemd (212-3 -> 213-5)
    [2014-06-05 21:11] [PACMAN] upgraded systemd-sysvcompat (212-3 -> 213-5)
    [2014-06-05 21:11] [PACMAN] upgraded x264 (1:142.20140311-1 -> 1:142.20140311-4)
    [2014-06-05 21:11] [PACMAN] upgraded xchat (2.8.8-13 -> 2.8.8-14)
    [2014-06-05 21:11] [PACMAN] upgraded xfconf (4.10.0-3 -> 4.10.0-4)
    Downgrading systemd and systemd-sysvcompat makes my computer boots normally:
    [2014-06-05 21:43] [PACMAN] Running 'pacman -U /var/cache/pacman/pkg/systemd-212-3-x86_64.pkg.tar.xz /var/cache/pacman/pkg/systemd-sysvcompat-212-3-x86_64.pkg.tar.xz'
    [2014-06-05 21:43] [PACMAN] downgraded systemd (213-5 -> 212-3)
    [2014-06-05 21:43] [PACMAN] downgraded systemd-sysvcompat (213-5 -> 212-3)

  • How to use nested for-each in XSLT

    Hi all,
    This is my sample input xml.
    <Conditions>
    <Filter operand="AND">
    <Filter operand="OR">
    <Condition Class="a" Object="b">
    <OperandType>Prompt</OperandType>
    </Condition>
    <Condition Class="Advanced" Object="%">
    <OperandType>Prompt</OperandType>
    </Condition>
    </Filter>
    <Condition Class="a" Object="b">
    <OperandType>Prompt</OperandType>
    </Condition>
    <Filter operand="OR">
    <Condition Class="Advanced" Object="%">
    <OperandType>Prompt</OperandType>
    </Condition>
    </Filter>
    </Filter>
    </Conditions>
    I want my output as
    <sawx:expr xsi:type="sawx:logical" op="and">
    <sawx:expr xsi:type="sawx:logical" op="or">
    <sawx:expr xsi:type="sawx:special" op="prompted">
    <sawx:expr xsi:type="sawx:sqlExpression">"a"."b"</sawx:expr></sawx:expr>
    <sawx:expr xsi:type="sawx:special" op="prompted">
    <sawx:expr xsi:type="sawx:sqlExpression">"Advanced"."%"</sawx:expr></sawx:expr></sawx:expr>
    </sawx:expr>
    <sawx:expr xsi:type="sawx:logical" op="or">
    <sawx:expr xsi:type="sawx:special" op="prompted">
    <sawx:expr xsi:type="sawx:sqlExpression">"a"."b"</sawx:expr>
    </sawx:expr>
    Can someone tell me how to get this output through xslt?

    Hi,
    Could you please explain the mapping rules between input and ouput?
    Also check your output, it's not well-formed.

  • How to use for each loop in XSLT when my source is a multilayout file and db

    How do I use a for each loop in XSLT when my source is multilayout file and db .
    My multilayout file is basically contain 2 kind of data one for employee and another for dependent.
    Now my requirement is I want to read each line of data whether it is it is employee or dependent do a join with db and write it in my target file.
    eg :  File content
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar 456782 BRO RichaKumari 311289 INDIA
    2 Ravi            456882 BRO RichaKumari 311289 INDIA
    eg : db Content
    311289 RichaKumari TCS INDIA Bangalore [email protected]
    Now in Final File I need something like this :
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar RichaKumari 311289 TCS INDIA
    2 Ravi            RichaKumari 311289 TCS INDIA
    here 1 and 2 are the identifier which will decide which layout to follow .

    Hi,
    I think you'll need two nested for-each's... Something like...
    <xsl:for-each select="$root/row[layout = 1]">
    <xsl:variable name="employee" select="."/>
    ... write employee ...
    <xsl:for-each select="$root/row[layout = 2 and dependentid = $employee/id]">
    ... write dependent ...
    </xsl:for-each>
    </xsl:for-each>
    Cheers,
    Vlad

  • Product ID for second issue of multi viewer app

    hi,
    I've in this forum already found very usefull info about publishing the second issue of a free multi viewer app but still can't figure out if we have to use the same Product ID  for each issue, or do we need to create a different Product ID for each issue ?
    I've put two examples below, suppose one of them has to right. Or not ??
    Is this the way to handle multiple issues (option 1):
    product ID issue 1 = Product ID issue 2 = com.magnusmedia.magname
    Or is this the right way (option 2):
    product ID issue 1 = com.magnusmedia.magname.01
    product ID issue 2 = com.magnusmedia.magname.02
    thanx in adavance
    Herman
    Allright, was in a hurry and tested it out myself.
    Option 2 is working for me, hope it's right to handle it that way.
    With option 1 the app crashes (dark gray screen, no folio opens, library- en scrolling buttons are available but)

    Short answer: Yes, use a different Product ID for each folio (or for each set of folio renditions).
    Longer answer: It's confusing that there are three different types of Apple Product IDs:
    (1) the app Product ID, which you can ignore
    (2) subscription duration Product IDs for a paid app or a single Product ID for a free subscription app
    (3) a Product ID for each retail folio
    When you're setting up a free subscription app, you don't need to use iTunes to create a Product ID for individual folios, because your folios are free. You just need to set up a free subscription Product ID in iTunes Connect and specify that Product ID in the DPS App Builder. On the Adobe side, you use a different Product ID for different folios you publish, such as com.publisher.publication.2012October and com.publisher.publication.2012November.  If you're creating renditions, you use the same Product ID for the different renditions and different Product IDs for different sets of renditions.

  • Variables + for each group + xml publisher

    Hi All,
    My requirement: one group is repeating many times, but based on one data in that group i need to display it.
    Ex:
    <GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP>
    In the above exapmle if u see the date xml tag holds 2 different dates which is same (repeating twice). But while displaying i need to show that only once.
    Means.. 23-July-2007 - 1 time and 10-Aug-2008 - 1 time instead of twice.
    I tried through using variables. getting the first date in that variable and checking with others. But not able to compare those..... (No idea)
    How can we achieve that. Please someone help me in this ASAP.
    Thanks in Advance,
    Vinoth

    Shanmu, thanks for responding -- I think I may have actually figured this out. I believe I had a trailing "/" on my "select" on the for-each-group that wasn't supposed to be there. I've reviewed this stuff so many times my eyes are crossed -- but this time I saw it. I've done some additional testing and it appears to be working properly, although I'm going to be extending the functionality now to include a nested for-each-group so we'll see how that goes.
    I'm marking this one as answered for now as it does appear to be working as expected.
    Thanks!!

  • Issues with nested for loops - saving images from a camera

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Labview problem.jpg ‏3841 KB
    Image sequence save to file.vi ‏48 KB

    Miika,
    the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Capturing image sequences - issues with nested for loops

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem?  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Image sequence save to file.vi ‏48 KB
    Labview problem.jpg ‏3841 KB

    Hi,
    You cannot create a folder if this one is already existing.
    Just check that the folder exists before creating it.
    Regards

  • Issue with XSLT For each loop in B2B Mapping

    Hi All,
    I am trying to map the inbound 997 Payload into Headers and Lines Table. I am using the For Each XSLT Construct to map the Loop AK2 of 997 into the 997 Lines Collection.
    Issue I am facing is that if the Loop AK2 is repeated for 33 times then for all the 33 times only its first element's value is getting passed into the target of mapping file.
    in coming payload
    <Loop-AK2>
    <Segment-AK2>
    <Element-143>810</Element-143>
    <Element-329>0001</Element-329>
    </Segment-AK2>
    <Segment-AK5>
    <Element-717>A</Element-717>
    </Segment-AK5>
    </Loop-AK2>
    <Loop-AK2>
    <Segment-AK2>
    <Element-143>810</Element-143>
    <Element-329>0002</Element-329>
    </Segment-AK2>
    <Segment-AK5>
    <Element-717>A</Element-717>
    </Segment-AK5>
    </Loop-AK2>
    <Loop-AK2>
    <Segment-AK2>
    <Element-143>810</Element-143>
    <Element-329>0003</Element-329>
    </Segment-AK2>
    <Segment-AK5>After transformation using XSLT file the payload looks like as follows
    <ns0:XxmfiEdi997_AckLines>
    <ns0:lineId>33</ns0:lineId>
    <ns0:trxSetIdentCode>810</ns0:trxSetIdentCode>
    <ns0:trxSetControlNumber>0001</ns0:trxSetControlNumber>
    <ns0:segmentCode/>
    <ns0:segmentPosition/>
    <ns0:segmentError/>
    <ns0:trxSetAckCode>A</ns0:trxSetAckCode>
    </ns0:XxmfiEdi997_AckLines>
    <ns0:XxmfiEdi997_AckLines>
    <ns0:lineId>34</ns0:lineId>
    <ns0:trxSetIdentCode>810</ns0:trxSetIdentCode>
    <ns0:trxSetControlNumber>0001</ns0:trxSetControlNumber>
    <ns0:segmentCode/>
    <ns0:segmentPosition/>
    <ns0:segmentError/>
    <ns0:trxSetAckCode>A</ns0:trxSetAckCode>
    </ns0:XxmfiEdi997_AckLines>
    <ns0:XxmfiEdi997_AckLines>
    <ns0:lineId>35</ns0:lineId>
    <ns0:trxSetIdentCode>810</ns0:trxSetIdentCode>
    <ns0:trxSetControlNumber>0001</ns0:trxSetControlNumber>
    <ns0:segmentCode/>
    <ns0:segmentPosition/>
    <ns0:segmentError/>
    <ns0:trxSetAckCode>A</ns0:trxSetAckCode>
    </ns0:XxmfiEdi997_AckLines>
    <ns0:XxmfiEdi997_AckLines>
    <ns0:lineId>36</ns0:lineId>
    <ns0:trxSetIdentCode>810</ns0:trxSetIdentCode>
    <ns0:trxSetControlNumber>0001</ns0:trxSetControlNumber>
    <ns0:segmentCode/>
    <ns0:segmentPosition/>
    <ns0:segmentError/>
    <ns0:trxSetAckCode>A</ns0:trxSetAckCode>
    </ns0:XxmfiEdi997_AckLines>
    <ns0:XxmfiEdi997_AckLines>
    <ns0:lineId>37</ns0:lineId>
    <ns0:trxSetIdentCode>810</ns0:trxSetIdentCode>
    <ns0:trxSetControlNumber>0001</ns0:trxSetControlNumber>
    <ns0:segmentCode/>
    <ns0:segmentPosition/>the Element-329 of incoming source payload is mapped to trxSetControlNumber of target payload, the issue is obvious from the above XML data that trxSetControlNumber is always having the value 0001 for every occurence where as its expected to fetch the value of the element of its corresponding occurence not the first elements value.
    Please find below the xslt file code i used for mapping
    <ns0:XxmfiEdi997_AckHeadersCollection>
          <ns0:XxmfiEdi997_AckHeaders>
            <ns0:headerId>
              <xsl:value-of select='oraext:sequence-next-val("XXMFI_EDI_997_ACK_HEADERS_S","jdbc/MTSI-apps")'/>
            </ns0:headerId>
            <ns0:processFlag>
              <xsl:text disable-output-escaping="no">I</xsl:text>
            </ns0:processFlag>
             <ns0:xxmfiEdi997_AckLinesCollection>
              <xsl:for-each select="/ns1:Transaction-997/ns1:Loop-AK2">
                <ns0:XxmfiEdi997_AckLines>
                  <ns0:lineId>
                    <xsl:value-of select='oraext:sequence-next-val("XXMFI_EDI_997_ACK_LINES_S","jdbc/MTSI-apps")'/>
                  </ns0:lineId>
                  <ns0:trxSetIdentCode>
                    <xsl:value-of select="/ns1:Transaction-997/ns1:Loop-AK2/ns1:Segment-AK2/ns1:Element-143"/>
                  </ns0:trxSetIdentCode>
                  <ns0:trxSetControlNumber>
                    <xsl:value-of select="ns1:Segment-AK2/ns1:Element-329"/>
                  </ns0:trxSetControlNumber>
                  <ns0:segmentError>
                    <xsl:value-of select="/ns1:Transaction-997/ns1:Loop-AK2/ns1:Loop-AK3/ns1:Segment-AK3/ns1:Element-720"/>
                  </ns0:segmentError>
                  <ns0:trxSetAckCode>
                    <xsl:value-of select="/ns1:Transaction-997/ns1:Loop-AK2/ns1:Segment-AK5/ns1:Element-717"/>
                  </ns0:trxSetAckCode>
                </ns0:XxmfiEdi997_AckLines>
              </xsl:for-each>
            </ns0:xxmfiEdi997_AckLinesCollection>
          </ns0:XxmfiEdi997_AckHeaders>Is there something I am doing wrong in mapping or am I missing something here. Please suggest .
    Thanks in advance
    ~TK.

    Hi,
    In your xslt code within the for loop, for the trxSetIdentCode why are you using the xpath "/ns1:Transaction-997/ns1:Loop-AK2/ns1:Segment-AK2/ns1:Element-143"? It should be just "ns1:Segment-AK2/ns1:Element-143". Similar changes for segmentError and trxSetAckCode also should be done. Remove the '/ns1:Transaction-997/ns1:Loop-AK2/' part from your xpath expressions inside the for loop and try it.
    Sahay

  • Mapping issue: FCC: Idoc for each record in file

    Hi,
    I have file to Idoc scenario.
    I receive csv file with multiple records.
    The requirement is to create an Idoc for each record.
    For eg.
    source file
    A1,B1,C1
    A2,B2,C2
    A3,B3,C3
    After FCC
    <MT>
    <TRANS>
    <ROW>
    <A>A1</A>
    <B>B1</B>
    <C>C1</C>
    </ROW>
    <ROW>
    <A>A2</A>
    <B>B2</B>
    <C>C2</C>
    </ROW>
    <ROW>
    <A>A3</A>
    <B>B3</B>
    <C>C3</C>
    </ROW>
    </TRANS>
    <MT>
    I have first tested it with only 1 record to test end to end connectivity. It works as expected and Idoc is posted to target system.
    Now when I am trying to send multiple records, I am getting some issues.
    Below are the steps that I have taken to process multiple records:
    1. Changed the cardinality of ROW (child of RecordSet) from 1 to Unbounded.
    2. Changed the occurance of Idoc to Unbounded.
    3. Mapped ROW to Idoc root.
    I have tested the mapping in IR and it generates multiple IDOCs.
    When I send the test file, it fails with error Tag found instead of tag IDOC BEGIN=
    I can see the xml message created with multiple ROWs in XI by File adapter in sxmb_moni.
    When I do Test Configuration in ID, with the XML message extracted from sxmbmoni, the result that I got was:_
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    This means that idoc was not created while mapping.
    But the same sample message works OK in IR!
    Pls help where I have missed.
    Regards,
    Anirudh.

    Sudhir,
    Thanks for your response.
    FCC is working fine. I have taken the XML message in XI created after FCC from csv sample message.
    I have tested this message in IR by placing it between
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
    </ns0:Message1>
    </ns0:Message>
    It is working fine and Idocs are created in mapping in IR.
    But the same sample message is creating below output ID!
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    Regards,
    Anirudh.

  • Timing Issue - Running sqlplus for each script in a list of scripts

    I have a large number of folders with sql scripts that I need to run from windows with sqlplus. The problem is the scripts must be run in order. When I loop through the scripts and run sqlplus for each one, they sometimes fail because things in the prior script are not yet available.
    So I added a jdbc client that checks a table for when the data is available from the prior sqlplus script. It says yes the data is visible in the table so the script can launch the next SQLPlus process but it fails unless I put a 2 second sleep in.
    Because sqlplus doesn't have a "CD" command and there are limitations with SQL_PATH and relative imported child scripts, I'm afraid I'm stuck with running multiple sqlplus sessions.

    I should clarify that I'm looking for a way to run scripts in sequence with sqlplus. There is an issue where one sqlplus session commits and exits and the next starts but the commit is not yet available to the new sqlplus session. To me this is a bug with sqlplus but maybe someone can explain how this is a "feature".

Maybe you are looking for

  • Problem reading an xml file using java

    i have a Com File which is called through .Net application and i made another java application that call the same COM file using JNI . but the problem is that the xml format generated from the Com file in case of the .Net application is approx 49.9K

  • External hard drive not appearing when entering time machine.

    Why does my external hard drive back up on time machine ok, but when I enter time machine (and the external device isn't plugged in) i can't see it? It appears in time machine fine when the external drive is plugged in, but just not if it's been ejec

  • How to pass NULL out of a service on an int member

    I accidentally posted this over in the VB section.  It would be helpful if a moderator could move it over here. Thanks. http://social.msdn.microsoft.com/Forums/vstudio/en-US/d339e6ac-9afc-4d71-84ac-47317e9e8de3/assigning-null-to-int-in-a-sqldatareade

  • T440 Won't Log Off or Turn Off

     The issue is the machine will not log off or shut down. If you try to do either, you hear the tones, but then the screen doesn't do anything. It just sits at the desktop background. The icons and task bar are gone. You can see and move the mouse. Th

  • How can I get my photos from my phone when it's asking to restore the handset?

    I've just done a system upgrade on my phone and then it asked to restore.  The thing is I don't want to lose any of my pictures or videos.  Can I get round this?