XSLT Question: xsl:for-each select="//MYELEMEMT[1]"

Hi everybody,
does anybody know, what [1] means?
Thanks Regards Mario

Check this:
http://www.w3schools.com/xpath/xpath_examples.asp
<i>select the First book Node
The following example selects only the first book node under the bookstore element:
xmlDoc.selectNodes("/bookstore/book[0]")
If you have IE 5 or higher you can try it yourself
Note: IE5 and later has implemented that [0] should be the first node, but according to the W3C standard it should have been [1]!!
A Workaround!
To solve the [0] and [1] problem in IE5+, you can set the SelectionLanguage to XPath.
The following example selects only the first book node under the bookstore element:
xmlDoc.setProperty "SelectionLanguage", "XPath"
xmlDoc.selectNodes("/bookstore/book[1]")</i>
Regards
Stefan

Similar Messages

  • Xsl Problem( xsl:for-each .... )

    Hi
    I have Xml Dom Object which contain
    <Root>
       <CD>
          <Title>Empire Burlesque</Title>
          <artist>Bob Dylan</artist>
          <Price>10.50</Price>
       </CD>
    </Root> my XSL contain
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="MPRoot">
      <html>
        <body>
        <h2>My CD Collection</h2>
        <table border="1">
          <xsl:for-each select="cd">
          <tr>
            <td><xsl:value-of select="title" /></td>
            <td><xsl:value-of select="artist" /></td>
            <td><xsl:value-of select="price" /></td>
          </tr>
          </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet> I m not getting My Desire Out put �
    I am getting all the Static Value which I have Written before (<xsl:for-each select="cd">) I have already try with (<xsl:for-each select="Root/cd"> and <xsl:for-each select="/cd"> and <xsl:for-each select="./cd">)
    Regards,
    Nilesh

    Your main template selects MPRoot elements. You don't have any MPRoot elements in your example XML. However let's suppose that your example XML is a lie and that those Root elements are MPRoot elements in real life. Then, your xsl:for-each selects cd elements. But your Root elements don't have any cd elements as children. They do have CD elements, though. So if that part of the example wasn't a lie, try <xsl:for-each select="CD"> instead.

  • Xsl for-each  not working in BPEL

    Hi,
    My input xml would contain the attribute @SourceModified at many places. In a xsl, for each occurence of that attribute I need to assign a set of values and then invoke a partnerlink.
    My code is
    <xsl:template match="/">
    <xsl:for-each select="//@SourceModified">
    <db:InputParameters>
    <db:before_text>
    <xsl:value-of select="normalize-space(.)"/>
    </db:before_text>
    <db:after_text>
    <xsl:value-of select="normalize-space(..)"/>
    </db:after_text>
    </db:InputParameters>
    </xsl:for-each>
    </xsl:template>
    Say if my input xml has the @SourceModified at 3 places, 3 different sets of values should get assigned to
    <db:InputParameters>.
    When I test the xsl in jdeveloper, i can see <db:InputParameters> coming 3 times. But when I deploy and test the BPEL process, only for the first occurence of @SourceModified, <db:InputParameters> is getting assigned in the transform.
    Please let me know how to fix this.

    hi,
    I am sending multiple @SourceModified elements. Also, i could not see any <list><db:InputParameters></list>.
    Only 1 set of value for <db:InputParameters> is getting assigned.
    I achieved the requirement in another way.
    1. counted the occurence of @SourceModified using ora:countNodes & assigned a variable count = 0
    Inside a while loop, while count<ora:countNodes(@SourceModified)
    1. i tempCountVar = count + 1
    2. pass the tempCount variable to my xsl using passing parameters to xsd.
    3. Inside the xsl, add a if condition
    <xsl:template match="/">
    <xsl:for-each select="//@SourceModified">
    *<xsl:if test select="position() = tempCountVar>*
    <db:InputParameters>
    <db:before_text>
    <xsl:value-of select="normalize-space(.)"/>
    </db:before_text>
    <db:after_text>
    <xsl:value-of select="normalize-space(..)"/>
    </db:after_text>
    </db:InputParameters>
    </xsl:if>
    </xsl:for-each>
    </xsl:template>
    4. increment the count
    This worked for me. I am able to get different values of <db:InputParameters>

  • 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

  • XSLT for-each within another for-each

    Hi All,
    My XSLT mapping needs to pick a field(BOL) from the Header and the using that, search the Items node for the matching BOL and generate the output accordingly.
    My current XSLT is as follows(not the entire program, just the snippet)
         <xsl:for-each select="ns0:Messages/ns0:Message1/ns1:MT_Header/Header">
                          <xsl:param name="search"><xsl:value-of select="bol"/></xsl:param>
         <xsl:for-each select="ns0:Messages/ns0:Message2/ns1:MT_Items/Item[BOL=$search]">
                  <Output>
                     <BOL_ITEM><xsl:value-of select="BOL_ITEM"/></BOL_ITEM>
                </Output>     
         </xsl:for-each>
         </xsl:for-each>
    The following code works correctly(without the outer for-each and with hardcoding)
                             <xsl:param name="search">100</xsl:param>
         <xsl:for-each select="ns0:Messages/ns0:Message2/ns1:MT_Items/Item[BOL=$search]">
                  <Output>
                     <BOL_ITEM><xsl:value-of select="BOL_ITEM"/></BOL_ITEM>
                </Output>     
         </xsl:for-each>
    So its the for-each within another for-each that does not work . Is there some syntax problem ? Or another way to achieve this in XSLT?

    Closing this thread

  • 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

  • For each in xslt

    From the attachment, The 'string' element under the record 'AoIAgeGroups' is set to unbounded.
    I am working on xslt, want to loop through every element of string and display as output.
    The xslt is as below:
    <types:Line>Age Groups:</types:Line>
      <xsl:for-each select="s1:AoIAgeGroups/s3:string">
       <types:Line><xsl:value-of select="text()"/></types:Line>
      </xsl:for-each>
    But I am getting only the first element in xml input string. It's not listing everything in it.
    The input xml is as below:
    <AoIAgeGroups xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <b:string>0-5 years</b:string>
    <b:string>6-12 years</b:string>
    <b:string>13-24 years</b:string>
    <b:string>25-65 years</b:string>
    <b:string>65+ years</b:string>
    </AoIAgeGroups>
    Currently it's listing only the 0-5 years of the input xml string. I want to list out all others so the output will be
    0-5 years
    6-12 years
    13-24 years
    25-65 years
    65+ years

    <?xml version="1.0" encoding="utf-16" ?>
    - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 s1 userCSharp" version="1.0" xmlns:ns0="http://esb/email/2011/01" xmlns:types="http://esb/email/types/2011/01" xmlns:s3="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:s2="http://esb/phrc/1" xmlns:s1="http://esb/registration/1" xmlns:s0="http://esb/shared/1" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    - <xsl:template match="/">
    <xsl:apply-templates select="/s1:Registration" />
    </xsl:template>
    - <xsl:template match="/s1:Registration">
    - <ns0:Plain>
    <types:Subject>Form Submission for Registration</types:Subject>
    - <types:DeliveryReceipt>
    <xsl:text>0</xsl:text>
    </types:DeliveryReceipt>
    - <types:ReadReceipt>
    <xsl:text>0</xsl:text>
    </types:ReadReceipt>
    - <types:From>
    - <xsl:choose>
    - <xsl:when test="string-length(s1:PersonalDetails/s0:ContactDetails/s0:EmailAddress/text()) > 0">
    - <types:EmailAddress>
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:EmailAddress/text()" />
    </types:EmailAddress>
    </xsl:when>
    - <xsl:otherwise>
    <xsl:variable name="var:v6" select="ScriptNS0:Read("eFormsV2" , "DefaultCitizenFromEmail")" />
    - <types:EmailAddress>
    <xsl:value-of select="$var:v6" />
    </types:EmailAddress>
    </xsl:otherwise>
    </xsl:choose>
    <types:DisplayName>Form Submission for Registration</types:DisplayName>
    </types:From>
    - <types:To>
    <xsl:variable name="var:v6" select="ScriptNS0:Read("eFormsV2" , "PHRCRegistrationDepartmentEmail")" />
    - <types:EmailAddress>
    <xsl:value-of select="$var:v6" />
    </types:EmailAddress>
    </types:To>
    <types:Line>The following message has been submitted.</types:Line>
    <types:Line />
    - <!-- Details collected for all types of membership
    -->
    <types:Line>Details:</types:Line>
    <types:Line />
    - <types:Line>
    Name:
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:Title/text()" />
    <xsl:text />
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:FirstName/text()" />
    <xsl:text />
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:Surname/text()" />
    </types:Line>
    <types:Line />
    - <xsl:if test="string-length(s1:PersonalDetails/s0:ContactDetails/s0:EmailAddress/text()) > 0">
    - <types:Line>
    Email:
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:EmailAddress/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    - <xsl:if test="string-length(s1:PersonalDetails/s0:ContactDetails/s0:MobilePhone/text()) > 0">
    - <types:Line>
    Mobile Phone:
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:MobilePhone/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    - <types:Line>
    Type of Membership:
    <xsl:value-of select="s1:TypeOfMembership/text()" />
    </types:Line>
    <types:Line />
    - <!-- Home details only collected for Professionals and students
    -->
    - <xsl:if test="s1:TypeOfMembership/text() = 'Student' or s1:TypeOfMembership/text() = 'Professional'">
    <types:Line />
    - <xsl:if test="string-length(s1:PersonalDetails/s0:ContactDetails/s0:HomePhone/text()) > 0">
    - <types:Line>
    Home Phone:
    <xsl:value-of select="s1:PersonalDetails/s0:ContactDetails/s0:HomePhone/text()" />
    </types:Line>
    <types:Line />
    </xsl:if>
    <types:Line>Address:</types:Line>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:BusinessName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:BusinessName/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:HouseName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:HouseName/text()" />
    </types:Line>
    </xsl:if>
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:HouseNumber/text()" />
    <xsl:text />
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:Street/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:Locality/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:Locality/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:Town/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:Town/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:County/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:County/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:PersonalDetails/s0:AddressDetails/s0:PostCode/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:PersonalDetails/s0:AddressDetails/s0:PostCode/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    </xsl:if>
    - <!-- Course Details are only collected for students
    -->
    <types:Line />
    - <xsl:if test="s1:TypeOfMembership/text() = 'Student'">
    - <types:Line>
    Course Title:
    <xsl:value-of select="s1:CourseDetails/s2:CourseTitle/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Department/text()) > 0">
    - <types:Line>
    Department:
    <xsl:value-of select="s1:CourseDetails/s2:Department/text()" />
    </types:Line>
    </xsl:if>
    - <types:Line>
    College / University:
    <xsl:value-of select="s1:CourseDetails/s2:EstablishmentName/text()" />
    </types:Line>
    <types:Line />
    <types:Line>College / University Address:</types:Line>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:BusinessName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:BusinessName/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:HouseName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:HouseName/text()" />
    </types:Line>
    </xsl:if>
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:HouseNumber/text()" />
    <xsl:text />
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:Street/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:Locality/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:Locality/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:Town/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:Town/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:County/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:County/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:Address/s0:PostCode/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:Address/s0:PostCode/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    - <types:Line>
    Tutors contact no.:
    <xsl:value-of select="s1:CourseDetails/s2:Tutor/s0:ContactDetails/s0:WorkPhone/text()" />
    </types:Line>
    <types:Line />
    - <types:Line>
    Tutors email address:
    <xsl:value-of select="s1:CourseDetails/s2:Tutor/s0:ContactDetails/s0:EmailAddress/text()" />
    </types:Line>
    <types:Line />
    <types:Line>Term time address:</types:Line>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:BusinessName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:BusinessName/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:HouseName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:HouseName/text()" />
    </types:Line>
    </xsl:if>
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:HouseNumber/text()" />
    <xsl:text />
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:Street/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:Locality/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:Locality/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:Town/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:Town/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:County/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:County/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:CourseDetails/s2:TermTimeAddress/s0:PostCode/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:CourseDetails/s2:TermTimeAddress/s0:PostCode/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    </xsl:if>
    - <xsl:if test="s1:TypeOfMembership/text() = 'Professional'">
    <types:Line />
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:ProfessionalCategory/text()) > 0">
    - <types:Line>
    Professional Category:
    <xsl:value-of select="s1:ProfessionalDetails/s2:ProfessionalCategory/text()" />
    </types:Line>
    <types:Line />
    </xsl:if>
    - <types:Line>
    Line Managers Name:
    <xsl:value-of select="s1:ProfessionalDetails/s2:LineManager/s0:ContactDetails/s0:FirstName/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:LineManager/s0:ContactDetails/s0:WorkPhone/text()) > 0">
    - <types:Line>
    Line Managers No.:
    <xsl:value-of select="s1:ProfessionalDetails/s2:LineManager/s0:ContactDetails/s0:WorkPhone/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    </xsl:if>
    - <!-- Employment details only collected for professional and leaflet members
    -->
    - <xsl:if test="s1:TypeOfMembership/text() = 'Professional' or s1:TypeOfMembership/text() = 'Only want to order leaflets'">
    <types:Line />
    - <types:Line>
    Job Title:
    <xsl:value-of select="s1:ProfessionalDetails/s2:JobTitle/text()" />
    </types:Line>
    <types:Line />
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Department/text()) > 0">
    - <types:Line>
    Department:
    <xsl:value-of select="s1:ProfessionalDetails/s2:Department/text()" />
    </types:Line>
    <types:Line />
    </xsl:if>
    - <types:Line>
    Organisation:
    <xsl:value-of select="s1:ProfessionalDetails/s2:Organisation/text()" />
    </types:Line>
    <types:Line />
    <types:Line>Address:</types:Line>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:BusinessName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:BusinessName/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:HouseName/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:HouseName/text()" />
    </types:Line>
    </xsl:if>
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:HouseNumber/text()" />
    <xsl:text />
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:Street/text()" />
    </types:Line>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:Locality/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:Locality/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:Town/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:Town/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:County/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:County/text()" />
    </types:Line>
    </xsl:if>
    - <xsl:if test="string-length(s1:ProfessionalDetails/s2:Address/s0:PostCode/text()) > 0">
    - <types:Line>
    <xsl:value-of select="s1:ProfessionalDetails/s2:Address/s0:PostCode/text()" />
    </types:Line>
    </xsl:if>
    <types:Line />
    - <types:Line>
    Work telephone numbers:
    <xsl:value-of select="s1:ProfessionalDetails/s2:PhoneNumbers/text()" />
    </types:Line>
    <types:Line />
    </xsl:if>
    <types:Line />
    - <types:Line>
    Confirmation box name:
    <xsl:value-of select="s1:AcceptanceName/text()" />
    </types:Line>
    <types:Line />
    <types:Line />
    <types:Line>Areas of interest</types:Line>
    <types:Line />
    <types:Line>Age Groups:</types:Line>
    - <xsl:for-each select="s1:AoIAgeGroups/s3:string">
    - <types:Line>
    <xsl:value-of select="text()" />
    </types:Line>
    </xsl:for-each>
    <types:Line />
    <types:Line>Topics:</types:Line>
    - <xsl:for-each select="s1:AoITopics/s3:string">
    - <types:Line>
    <xsl:value-of select="text()" />
    </types:Line>
    </xsl:for-each>
    </ns0:Plain>
    </xsl:template>
    </xsl:stylesheet>
    <?xml version="1.0" encoding="utf-8" ?>
    - <Registration xmlns="http://esb/registration/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    - <MetaData xmlns:b="http://esb/shared/1">
    <b:UTRN>W86180141692</b:UTRN>
    <b:EnquiryType i:nil="true" />
    <b:SubType i:nil="true" />
    <b:RequestStatus i:nil="true" />
    <b:RequestSubStatus i:nil="true" />
    <b:CreatedBy i:nil="true" />
    <b:Application i:nil="true" />
    <b:LGNLCategory i:nil="true" />
    <b:FormRef i:nil="true" />
    <b:FormVersion i:nil="true" />
    <b:ProcessStage i:nil="true" />
    <b:CreatedWhen i:nil="true" />
    <b:CreatedWhere i:nil="true" />
    <b:CreatedHow i:nil="true" />
    <b:SentFlag i:nil="true" />
    </MetaData>
    - <PersonalDetails xmlns:b="http://esb/shared/1">
    - <b:ContactDetails>
    <b:Title>Mr</b:Title>
    <b:FirstName>f</b:FirstName>
    <b:Surname>surname</b:Surname>
    <b:EmailAddress>[email protected]</b:EmailAddress>
    <b:HomePhone />
    <b:MobilePhone>m</b:MobilePhone>
    <b:WorkPhone i:nil="true" />
    <b:Fax i:nil="true" />
    <b:Minicom i:nil="true" />
    <b:PreferredContact i:nil="true" />
    </b:ContactDetails>
    - <b:AddressDetails>
    <b:FlatUnit />
    <b:UPRN>000072532081</b:UPRN>
    <b:BusinessName />
    <b:HouseName />
    <b:HouseNumber>1</b:HouseNumber>
    <b:Locality>Woodhouse</b:Locality>
    <b:Street>Delph Court</b:Street>
    <b:LPILevel />
    <b:Town>Leeds</b:Town>
    <b:County>Leeds</b:County>
    <b:Classification>RD06</b:Classification>
    <b:Country>United Kingdom</b:Country>
    <b:PostCode>LS6 2HL</b:PostCode>
    <b:Ward>Hyde Park and Woodhouse</b:Ward>
    </b:AddressDetails>
    </PersonalDetails>
    - <CourseDetails xmlns:b="http://esb/phrc/1">
    <b:CourseTitle />
    <b:Department />
    <b:EstablishmentName />
    - <b:Address xmlns:c="http://esb/shared/1">
    <c:FlatUnit />
    <c:UPRN i:nil="true" />
    <c:BusinessName />
    <c:HouseName />
    <c:HouseNumber />
    <c:Locality />
    <c:Street />
    <c:LPILevel i:nil="true" />
    <c:Town />
    <c:County />
    <c:Classification i:nil="true" />
    <c:Country i:nil="true" />
    <c:PostCode />
    <c:Ward i:nil="true" />
    </b:Address>
    - <b:Tutor xmlns:c="http://esb/shared/1">
    - <c:ContactDetails>
    <c:Title i:nil="true" />
    <c:FirstName i:nil="true" />
    <c:Surname i:nil="true" />
    <c:EmailAddress />
    <c:HomePhone i:nil="true" />
    <c:MobilePhone i:nil="true" />
    <c:WorkPhone />
    <c:Fax i:nil="true" />
    <c:Minicom i:nil="true" />
    <c:PreferredContact i:nil="true" />
    </c:ContactDetails>
    <c:AddressDetails i:nil="true" />
    </b:Tutor>
    <b:StudentEmailAddress i:nil="true" />
    - <b:TermTimeAddress xmlns:c="http://esb/shared/1">
    <c:FlatUnit />
    <c:UPRN i:nil="true" />
    <c:BusinessName />
    <c:HouseName />
    <c:HouseNumber />
    <c:Locality />
    <c:Street />
    <c:LPILevel i:nil="true" />
    <c:Town />
    <c:County />
    <c:Classification i:nil="true" />
    <c:Country i:nil="true" />
    <c:PostCode />
    <c:Ward i:nil="true" />
    </b:TermTimeAddress>
    </CourseDetails>
    - <ProfessionalDetails xmlns:b="http://esb/phrc/1">
    <b:ProfessionalCategory>Admin/Clerical/Management</b:ProfessionalCategory>
    - <b:LineManager xmlns:c="http://esb/shared/1">
    - <c:ContactDetails>
    <c:Title i:nil="true" />
    <c:FirstName>l</c:FirstName>
    <c:Surname i:nil="true" />
    <c:EmailAddress i:nil="true" />
    <c:HomePhone i:nil="true" />
    <c:MobilePhone i:nil="true" />
    <c:WorkPhone>lmn</c:WorkPhone>
    <c:Fax i:nil="true" />
    <c:Minicom i:nil="true" />
    <c:PreferredContact i:nil="true" />
    </c:ContactDetails>
    <c:AddressDetails i:nil="true" />
    </b:LineManager>
    <b:JobTitle>jt</b:JobTitle>
    <b:Department>d</b:Department>
    <b:Organisation>o</b:Organisation>
    - <b:Address xmlns:c="http://esb/shared/1">
    <c:FlatUnit />
    <c:UPRN>000072532081</c:UPRN>
    <c:BusinessName />
    <c:HouseName />
    <c:HouseNumber>1</c:HouseNumber>
    <c:Locality>Woodhouse</c:Locality>
    <c:Street>Delph Court</c:Street>
    <c:LPILevel />
    <c:Town>Leeds</c:Town>
    <c:County>Leeds</c:County>
    <c:Classification>RD06</c:Classification>
    <c:Country>United Kingdom</c:Country>
    <c:PostCode>LS6 2HL</c:PostCode>
    <c:Ward>Hyde Park and Woodhouse</c:Ward>
    </b:Address>
    <b:PhoneNumbers>wtn</b:PhoneNumbers>
    </ProfessionalDetails>
    <TypeOfMembership>Professional</TypeOfMembership>
    <WhoToldYou>how did you</WhoToldYou>
    <AcceptanceName>please</AcceptanceName>
    - <AoIAgeGroups xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <b:string>0-5 years</b:string>
    <b:string>6-12 years</b:string>
    <b:string>13-24 years</b:string>
    <b:string>25-65 years</b:string>
    <b:string>65+ years</b:string>
    </AoIAgeGroups>
    - <AoITopics xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <b:string>Accident prevention</b:string>
    <b:string>Healthy eating</b:string>
    <b:string>Mental health</b:string>
    <b:string>Parenting / Child health</b:string>
    <b:string>Physical activity</b:string>
    <b:string>Sexual health</b:string>
    <b:string>Substance use</b:string>
    </AoITopics>
    </Registration>

  • Xsl mapping - for each

    HI,
    my xsl mapping is working fine but the output is wrong.
    I need the information from the E1EDK02/BELNR if the E1EDK02/QUALF="002".
    Where is the mistake located ? The BELNR is allways the first one of all E1EDK02.
      <xsl:for-each select="ORDERS05/IDOC/E1EDK02[QUALF='002']">
    <!--   <xsl:for-each select="ORDERS05/IDOC/E1EDK02">-->
           <xsl:value-of select="ORDERS05/IDOC/E1EDK02/BELNR"/>
           </xsl:for-each>
    Thx,
    Gordon

    Hi,
    <xsl:for-each select="ORDERS05/IDOC/E1EDK02[QUALF='002']">
    <!-- <xsl:for-each select="ORDERS05/IDOC/E1EDK02">-->
    <b><xsl:value-of select="ORDERS05/IDOC/E1EDK02/BELNR"/></b> it is absolete path which will take first occurance always.
    </xsl:for-each>
    Use:<b><!-- <xsl:value-of select="BELNR">--></b>
    it is not absolete path.
    Regards,
    AKshay.
    Reward points if find useful.
    <b>** Mark question answered if solved.</b>
    Message was edited by:
            Akshay Jamgaonkar
    Message was edited by:
            Akshay Jamgaonkar

  • XSLT construct "for each" not working in transformation

    Hi everyone I am using for each inside a transformation it was working fine until added parameters.After included parameters "for each" is not happening the db is invoked only once even if there are muliple nodes.
    can anyone help me on this issue. How to perform for each if paramaters are included

    This is the transform I am using the element used for for each is of unbounded type (typens:getRoutingAndFrameJumpersResponse/typens:oServFrmJmprInfo/typens:oFrmJmpr/typens:item)
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="x.wsdl"/>
    <rootElement name="getRoutingAndFrameJumpersResponse" namespace="x.NetworkInstallations"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="XSD">
    <schema location="IROBO_PR_UPDATE_INSERT_JUMPER_INFO.xsd"/>
    <rootElement name="InputParameters" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/IROBO/PR_UPDATE_INSERT_JUMPER_INFO/"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.3.0(build 070615.0525) AT [TUE MAY 19 09:16:31 GMT+05:30 2009]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:typens="x.NetworkInstallations"
    xmlns:ns0="http://www.w3.org/2001/XMLSchema"
    xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/IROBO/PR_UPDATE_INSERT_JUMPER_INFO/"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:wsdlns="http://y.com/WSAI/STAA/"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    exclude-result-prefixes="xsl wsdl typens ns0 soap wsdlns db bpws ehdr hwf xp20 xref ora ids orcl">
    <xsl:param name="MigrationId"/>
    <xsl:param name="LineNumber"/>
    <xsl:param name="DN"/>
    <xsl:template match="/">
    <xsl:for-each select=*"/typens:getRoutingAndFrameJumpersResponse/typens:oServFrmJmprInfo/typens:oFrmJmpr/typens:item"*>
    <db:InputParameters>
    <db:P_MIGRATION_ID>
    <xsl:value-of select="$MigrationId"/>
    </db:P_MIGRATION_ID>
    <db:CCT_ID>
    <xsl:value-of select="$DN"/>
    </db:CCT_ID>
    <db:FROM__FRAME_TERM_ID>
    <xsl:value-of select="typens:frameTermID1"/>
    </db:FROM__FRAME_TERM_ID>
    <db:FROM_EXTRA>
    <xsl:value-of select="typens:reformattedTermID1"/>
    </db:FROM_EXTRA>
    <db:FROM_MAP>
    <xsl:value-of select="typens:locationIn"/>
    </db:FROM_MAP>
    <db:TO_FRAME_TERM_ID>
    <xsl:value-of select="typens:frameTermID2"/>
    </db:TO_FRAME_TERM_ID>
    <db:TO_EXTRA>
    <xsl:value-of select="typens:reformattedTermID2"/>
    </db:TO_EXTRA>
    <db:TO_MAP>
    <xsl:value-of select="typens:locationOut"/>
    </db:TO_MAP>
    <db:TRANSACTION_ID>
    <xsl:value-of select='substring-after(../../../typens:e2EData,"q=")'/>
    </db:TRANSACTION_ID>
    <db:SEQ_NO>
    <xsl:value-of select="position()"/>
    </db:SEQ_NO>
    <db:LINE_NO>
    <xsl:value-of select="$LineNumber"/>
    </db:LINE_NO>
    </db:InputParameters>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>

  • 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

  • Xsl for removing specific nodes and modifying one node.

    Hello,
    i have the urgent need to remove specific nodes
    and modify one node in my XML.
    the xml as input :
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
           </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
              <LAYERDEF id="0" visible="false" query="" />
              <LAYERDEF id="1" visible="false" query="" />
              <LAYERDEF id="2" visible="false" query="" />
              <LAYERDEF id="3" visible="false" query="" />
              <LAYERDEF id="4" visible="false" query="" />
              <LAYERDEF id="5" visible="false" query="" />
              <LAYERDEF id="6" visible="false" query="" />
              <LAYERDEF id="7" visible="false" query="" />
              <LAYERDEF id="8" visible="false" query="" />
              <LAYERDEF id="9" visible="false" query="" />
              <LAYERDEF id="10" visible="false" query="" />     
            </LAYERLIST>
            <MAPSERVICELIST>   
              <MAPSERVICEDEF  service="BASEMAP" >
                <LAYERLIST>
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
              <MAPSERVICEDEF service="MAP1">
                <LAYERLIST>
                  <LAYERDEF id="4" visible="True" query="" />
                  <LAYERDEF id="3" visible="True" query="" />
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
            </MAPSERVICELIST>
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    what i want to have is:
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
          </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
       <LAYERDEF id="6" visible="True" query="" />
                <LAYERDEF id="5" visible="True" query="" />
                <LAYERDEF id="4" visible="True" query="" />
                <LAYERDEF id="3" visible="False" query="" />
    <LAYERDEF id="2" visible="True" query="" />
    <LAYERDEF id="1" visible="False" query="" />       
            </LAYERLIST>
            <MAPSERVICELIST/>   
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    as you see, <MAPSERVICELIST/>   is empty and <LAYERLIST> contains all <LAYERDEF> of <MAPSERVICEDEF>/<LAYERLIST> 
     The ones  of BASEMAP  are kept unchanged  but the ones of MAP1 are having a new attribute value for id.
    Thanks four your help.
    Regards.

    You can implement very straightforward map in BizTalk like below:
    If you are interested in XSLT of this map, I copied below which visual studio gave me when i validated the map:
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/PLOT" />
    </xsl:template>
    <xsl:template match="/PLOT">
    <PLOT>
    <REQUEST>
    <GET_LAYOUT>
    <PROPERTIES>
    <MAPNAME>
    <xsl:if test="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name">
    <xsl:attribute name="name">
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name" />
    </xsl:attribute>
    </xsl:if>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/text()" />
    </MAPNAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/text()" />
    </PROPERTIES>
    <DATAFRAME>
    <xsl:if test="REQUEST/GET_LAYOUT/DATAFRAME/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/@id" />
    </xsl:attribute>
    </xsl:if>
    <LAYERLIST>
    <xsl:for-each select="REQUEST/GET_LAYOUT/DATAFRAME/MAPSERVICELIST/MAPSERVICEDEF">
    <xsl:for-each select="LAYERLIST/LAYERDEF">
    <LAYERDEF>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@id">
    <xsl:attribute name="id">
    <xsl:value-of select="@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@query">
    <xsl:attribute name="query">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@query" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@query">
    <xsl:attribute name="query">
    <xsl:value-of select="@query" />
    </xsl:attribute>
    </xsl:if>
    </LAYERDEF>
    </xsl:for-each>
    </xsl:for-each>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/LAYERLIST/text()" />
    </LAYERLIST>
    <MAPSERVICELIST>
    <xsl:text> </xsl:text>
    </MAPSERVICELIST>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/text()" />
    </DATAFRAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/text()" />
    </GET_LAYOUT>
    <xsl:value-of select="REQUEST/text()" />
    </REQUEST>
    </PLOT>
    </xsl:template>
    </xsl:stylesheet>
    You can highlight the issue if you have any specific one.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • XSLT mapping encoding for Korean language

    Hi all,
    I am using a XSLT mapping to ocnvert input XMl into flat file.Evrything seems to be working fine expect when Korean, Chinese, Vientam, etc characters are coming in the input file.
    I think the above mentioned characters are occupying 2 bytes in the flat file due to which the position of the next field got misplaced in the flat file.
    I tried with different unciode options in the following XSLT mapping.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:hsbc:a2r:corp:global:fi:paymentservice">
         <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8"/>
         <xsl:template match="/">
              <ns0:PS>
                   <Details>
                        <xsl:for-each select="ns0:PaymentService/Details">
                        <FileData>
                             <xsl:value-of select="FileData"/>
                        </FileData>
                        </xsl:for-each>
                   </Details>
              </ns0:PS>
         </xsl:template>
    </xsl:stylesheet>
    Not sure which encoding should be used here...

    > Not sure which encoding should be used here...
    Ask your customer or project lead.

  • 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

  • For Each function for a Concat Value

    Hi:
    The scenario is, we need to concat two unbounded elements and map it to a target element using for each functionality.
    For example
    <BookStore>
    <Books>
    <Name>NAME1</Name>
    <Author>AUTHOR1</Author>
    <BookId>1</BookId>
    <Quantity>2</Quantity>
    <Price></Price>
    <Status></Status>
    <Books>
    <Books>
    <Name>NAME2</Name>
    <Author>AUTHOR2</Author>
    <BookId>2</BookId>
    <Quantity>2</Quantity>
    <Price></Price>
    <Status></Status>
    <Books>
    </BookStore>
    I need to concat "Name" and "Author" which is under the unbounded element "BookStore" and map it to a single element called "Sample" on the Target side.
    I am not able to use the "for-each" XSLT function to get the multiple value of Name and Author since concat function is used. Is there any other way to concat and get the multiple values of the element "Name" and "Author"?
    Regards
    RK

    Hi Vlad:
    Ok i use for-each function in my XSLT to get the vlaues of unbounded elements
    eg:
    <xsl:for-each select="/BookStore/Books/Name">
    <request:Sample>
    <xsl:value-of select="/BookStore/Books/Name"/>
    </request:Sample>
    </xsl:for-each>
    This works perfectly fine and whenever there is a multiple vlaue for Name it is mapped to Sample and output comes as expected
    <Sample>NAME1</Sample>
    <Sample>NAME2</Sample>
    Now i need to concat the Name and Author and pass the value to element on the target. Since name and author occuring multiple times, i am not sure how to pass the values to the element on the target

  • Unable to perform for-each on quer-database() result

    Hi
    I am using the quer-database function in my XSLT which is returning more than 1 value.
    when i try assigning these values I am only able to assign the first row of elements. When I try dragging the for-each activity and try using it with the qurey-database node set I get an error saying "An expression must have only one link to the Target schema".
    Is there some way that I can achieve this in my XSLT?
    <xsl:template match="/">
    <xsl:for-each select="">
    <client:processResponse>
    <client:Name>
    <xsl:value-of select="oraext:query-database(concat(&quot;select entryid from XXLF_CHARACTERS where item_number=&quot;,&quot;'&quot;,/ns0:Customer/ns0:CustomerInfo,&quot;'&quot;),false(),true(),&quot;jdbc/devag&quot;)"/>
    </client:Name>
    <client:Name2>
    <xsl:value-of select="oraext:query-database(concat(&quot;select entryvalue from XXLF_CHARACTERS where item_number=&quot;,&quot;'&quot;,/ns0:Customer/ns0:CustomerInfo,&quot;'&quot;),false(),true(),&quot;jdbc/devag&quot;)"/>
    </client:Name2>
    </client:processResponse>
    </xsl:for-each>
    </xsl:template>
    This is what my XSLT looks like
    Thanks.

    You have to use ROW and ROWSET to be able to able to get multiple elements... See the sample bellow...
    http://neeraj-soa-tips.blogspot.com.au/2011/04/getting-xml-output-from-oraextquery.html
    Cheers,
    Vlad

Maybe you are looking for

  • Error in using IDOC create contract

    Hi experts,                I am using standard IDOC BLAORD03 to create contract,but comes across error 'Enter purchase group' as Purchase group is a mandatory filed,but in my IDOC i have value in EKGRP which is Purchase group,I look into FM IDOC_INPU

  • JNDI lookup from a JSP page (URGENT)

    Hello, In my JSP I was using the "conn = DriverManager.getConnection("URL","username", "password")" scheme to connect to the database. I want to change this to use the JNDI for the database lookup in the same JSP. After creating this JSP i am using t

  • Roundtrip AAC not showing clip indicators in OS 10.8.4

    I'm trying to use AU Lab to run RoundtripAAC and audition Codecs to check Masters for overs.  I have recently updated to the latest version of Mountain Lion (10.8.4). When I instantiate RoundtripAAC and the plugin in window comes up, it comes up in "

  • Can I pre-order Iphone 5 from apple website and does it cost extra to pre-order?

    Can I pre-order Iphone 5 from apple website and does it cost extra to pre-order?

  • Hi guys i m new ....having problem with T42 ~~

    Hi guys , as stated above, i m having afew problems with my laptop as it is my first time handling a com. i juz format my thinkpad 42 with my own OS.I have tried downloading every software in the webby but nothing seems to work..help guys ! wat do i