XSLT Mapping - replacing attribute value of a specific node

Hi,
I want to replace the value of an attribute for a specific node. Can you please tell me how this can be achieved using XSLT coding?
The input file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
     <EnvelopeVersion>2.0</EnvelopeVersion>
     <Header>
          <MessageDetails>
               <Class>IR-PAYE-MOV</Class>
               <Qualifier>request</Qualifier>
               <Function>submit</Function>
               <CorrelationID/>
               <Transformation>XML</Transformation>
               <GatewayTimestamp/>
          </MessageDetails>
          <SenderDetails>
               <IDAuthentication>
                    <SenderID>isv142</SenderID>
                    <Authentication>
                         <Method>MD5</Method>
                         <Value>1L2xFE8WqHHI5iVMGhixAg==</Value>
                    </Authentication>
               </IDAuthentication>
          </SenderDetails>
     </Header>
     <GovTalkDetails>
          <Keys>
               <Key Type="TaxOfficeNumber">123</Key>
               <Key Type="TaxOfficeReference">MD345</Key>
          </Keys>
          <ChannelRouting>
               <Channel>
                    <URI>0142</URI>
               </Channel>
          </ChannelRouting>
     </GovTalkDetails>
     <Body>
          <IRenvelope xmlns="http://www.govtalk.gov.uk/taxation/PAYE/MOV/09-10/1">
               <IRheader>
                    <Keys>
                         <Key Type="TaxOfficeNumber">123</Key>
                         <Key Type="TaxOfficeReference">MD345</Key>
                    </Keys>
                    <PeriodEnd>2009-09-29</PeriodEnd>
                    <DefaultCurrency>GBP</DefaultCurrency>
                    <IRmark Type="generic">03Bfkipk6UDWSXLj77ObBVoK894=</IRmark>
                    <Sender>Company</Sender>
               </IRheader>
               <InYearMovements>
                    <EmployerName>form p60</EmployerName>
                    <P46 Statement="A">
                         <Name>
                              <Fore>Smith</Fore>
                              <Sur>John</Sur>
                         </Name>
                         <Address>
                              <Line>Sterling Residency</Line>
                              <Line>Gehde</Line>
                              <Line>Hedge End</Line>
                              <Line>Southampton</Line>
                              <PostCode>12345678</PostCode>
                         </Address>
                         <WorksNumber>20090030</WorksNumber>
                         <NINO>NP258719D</NINO>
                         <BirthDate>1985-07-11</BirthDate>
                         <Gender>male</Gender>
                         <StartDate>2009-04-20</StartDate>
                         <TaxCodeInUse>647L</TaxCodeInUse>
                    </P46>
               </InYearMovements>
          </IRenvelope>
     </Body>
</GovTalkMessage>
I want to replace the value 'http://www.govtalk.gov.uk/taxation/PAYE/MOV/09-10/1' of attribute xmlns belonging to the node 'IRenvelope' with the value 'http://www.govtalk.gov.uk/taxation/PAYE/MOV/10-11/1'
So the output of the mapping should be:
<?xml version="1.0" encoding="UTF-8"?>
<GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
     <EnvelopeVersion>2.0</EnvelopeVersion>
     <Header>
          <MessageDetails>
               <Class>IR-PAYE-MOV</Class>
               <Qualifier>request</Qualifier>
               <Function>submit</Function>
               <CorrelationID/>
               <Transformation>XML</Transformation>
               <GatewayTimestamp/>
          </MessageDetails>
          <SenderDetails>
               <IDAuthentication>
                    <SenderID>isv142</SenderID>
                    <Authentication>
                         <Method>MD5</Method>
                         <Value>1L2xFE8WqHHI5iVMGhixAg==</Value>
                    </Authentication>
               </IDAuthentication>
          </SenderDetails>
     </Header>
     <GovTalkDetails>
          <Keys>
               <Key Type="TaxOfficeNumber">123</Key>
               <Key Type="TaxOfficeReference">MD345</Key>
          </Keys>
          <ChannelRouting>
               <Channel>
                    <URI>0142</URI>
               </Channel>
          </ChannelRouting>
     </GovTalkDetails>
     <Body>
          <IRenvelope xmlns="http://www.govtalk.gov.uk/taxation/PAYE/MOV/10-11/1">
               <IRheader>
                    <Keys>
                         <Key Type="TaxOfficeNumber">123</Key>
                         <Key Type="TaxOfficeReference">MD345</Key>
                    </Keys>
                    <PeriodEnd>2009-09-29</PeriodEnd>
                    <DefaultCurrency>GBP</DefaultCurrency>
                    <IRmark Type="generic">03Bfkipk6UDWSXLj77ObBVoK894=</IRmark>
                    <Sender>Company</Sender>
               </IRheader>
               <InYearMovements>
                    <EmployerName>form p60</EmployerName>
                    <P46 Statement="A">
                         <Name>
                              <Fore>Smith</Fore>
                              <Sur>John</Sur>
                         </Name>
                         <Address>
                              <Line>Sterling Residency</Line>
                              <Line>Gehde</Line>
                              <Line>Hedge End</Line>
                              <Line>Southampton</Line>
                              <PostCode>12345678</PostCode>
                         </Address>
                         <WorksNumber>20090030</WorksNumber>
                         <NINO>NP258719D</NINO>
                         <BirthDate>1985-07-11</BirthDate>
                         <Gender>male</Gender>
                         <StartDate>2009-04-20</StartDate>
                         <TaxCodeInUse>647L</TaxCodeInUse>
                    </P46>
               </InYearMovements>
          </IRenvelope>
     </Body>
</GovTalkMessage>
Thanks & Regards,
Aditi Naik

Hi,
You get name of an attribute by this code
<xsl:for-each select="@*">
    <xsl:text>Value of </xsl:text>
           <xsl:value-of select="name(.)"/>
    <xsl:text> is </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
Change value by providing new value in <xsl:value-of select="."/>
Regards
suraj

Similar Messages

  • XSLT mapping for fixed values

    Hi,
    i am doing a XSLT mapping. i have a field which has fixed values(can be performed using graphical mapping). but the same i am not able to implement for XSLT. can anyone give me a idea about this
    <removed by moderator>
    Thanks
    Deepika
    Edited by: Mike Pokraka on Jul 24, 2008 12:57 PM

    Step u2013 By u2013 Step Simple Approach for XSLT Mapping                         
    Step – By – Step Simple Approach for XSLT Mapping                         
    generic xslt mapping part 1                                             
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1                                             
    generic xslt mapping part2                                   
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a                                             
    xslt recursive templates                                             
    XSLT: Recursive Templates
    regards
    kummari

  • Error when replacing attribute value using LDAPConnection.modify()

    I am using Directory SDK 4.1 from netscape. I am trying to replace/modify the value of an attribute for a particular dn. Below is the code:
    LDAPConstraints constraints = new LDAPConstraints();
    constraints.setReferrals(true);
    LDAPAttribute attribute = new LDAPAttribute("passwordexpwarned","1");
    LDAPModification mod = new LDAPModification
    (LDAPModification.REPLACE , attribute);
    getLDAPConnection().modify(dn, mod,constraints);
    Automatic Referral Handling is enabled and I want to use to anonymous authentication. When I run the code, I get the following error:
    java.lang.ClassCastException: netscape.ldap.LDAPConstraints     at netscape.ldap.LDAPConnection.performReferrals(LDAPConnection.java:5057)
    at netscape.ldap.LDAPConnection.modify LDAPConnection.java:3121)
    at netscape.ldap.LDAPConnection.modify(LDAPConnection.java:2981)
    at PasswordExpiration.setPasswordWarnedAttribute(PasswordExpiration.java:305)
    Has anyone encountered the same error or could anyone provide me some input on what could be the reason for the error? I would greatly appreciate any help in this matter.
    Thanks for your time.

    you must use LDAPSearchConstraints instead of LDAPConstraints;
    the reason is a minor but awkward bug in LDAPJDK;

  • Replacing attribute value during runtime?

    Ok Here we go... Is it possible to replace the value of an attribute during query runtime??? 
    Here is what my user wants...They want the value of an attribute in a query (no the input selection) to change according to the current date for example:
    If today is monday then the value of 0VTYPE in a query is 10.
    If today is tuesday the same value of 0VTYPE in the same query would by 20.

    We need to use "Key Date" concept.
    Think you should get some idea by this link.
    http://help.sap.com/saphelp_nw70/helpdata/en/3f/083b37b0fd2e71e10000009b38f936/frameset.htm
    Thanks
    Hari

  • ADF dtv:map satelliteBaseMapName attribute value

    I am using jDeveloper11.1.2.1 and doing R&D on Geogriphical Map for our project.
    In all the tutorials for <dvt:map> "baseMapName" data source, geo-code and map-viewer are mentioned but I didn't find anything for "satelliteBaseMapName" and "hybridBaseMapName".
    If anyone can provide any link or help related to these attributes that would be grateful.
    Thanks.

    Hi,
    one workaround is to create a managed bean implementing java.util.Map to substitute the resource bundle. Then it will be always available when needed, as it is instantiated when first referenced, either from a bean or from the page.
    Example implementation:
    - create a class implementing java.util.Map and having an attribute of type Map,
    - in the constructor, you can load the current resource bundle (however, you need to already have an UIViewRoot to get the current Locale) and put all of its contents to the inner Map,
    - override the get() method to return the requested value from the inner Map,
    - register this class as a session-scoped managed bean (if you use multiple languages) or as an application-scoped managed bean (if you don't use different languages).
    Hope this helps,
    Patrik

  • How to set a attribute value of a sub node binded to a table.. pls respond.

    Hi friends,
    I have context defined like this.
         Head_node ( table 1)
              Item_node ( table 2, sub node ).  ( now this im saving in global internal table).
    so now when i hit save button, im passing my internal table (it has col1- sales order no, col2 item details(table type, which can have more than one record) to a FM, to create sales order.
    My sales order is getting saved.
    But the function module will return some new values (like sales order number, item number etc).
    Now i want these values to be updated in my context.
    Meaning whenever after that i do get_attribute, i should get these new (sales order no, item no ) also.
    I dont know how to set the context values of sub nodes , so im missing these values.
    kindly respond back to me..
    thanks in advance,
    Niraja

    Its very simple.
    Follow these steps. e.g you want to get the new sales order number. Define a attribute in ur node (or set of attributes in ur case as per reqruirement) say new_so_number.
    Check your FM, if its returning new_so_number then it's fine, otherwise you have to change the FM to return the new_so_number or you have to get from db table somehow, which best suites your req.
    So once you have new_so_number after calling the FM, say in lv_new_so_number field. Then write this code to set the attribute (change the variables as per your context attributes)
    DATA lo_nd_head TYPE REF TO if_wd_context_node.
      DATA lo_el_head TYPE REF TO if_wd_context_element.
      DATA ls_head TYPE wd_this->element_head.
      DATA lv_new_so_number LIKE ls_head-new_so_number.
    * navigate from <CONTEXT> to <HEAD> via lead selection
      lo_nd_head = wd_context->get_child_node( name = wd_this->wdctx_head ).
    * get element via lead selection
      lo_el_head = lo_nd_head->get_element(  ).
    lv_new_so_number = new_so_number. " (You got this as a exporting parameter of FM etc..)
    * get single attribute
      lo_el_head->set_attribute(
        EXPORTING
          name =  `NEW_SO_NUMBER`
          value = lv_new_so_number ).
    Hope it works.

  • Retrieve xml attribute value of nth xml node using xpath query

    I have an xml with following stucture...
    <xml>
    <header>
     <DocumentReference OrderId="order001">
     <DocumentReference OrderId="order002">
     <DocumentReference OrderId="order003">
    I have to loop through this xml and retrieve the orderId values inside Biztalk orchestration.
    In the expression shape, I get the count of 'DocumentReference' nodes using an xpath query and then
    Added a loopshape to make sure it loops thru all nodes
    Loop condition:   n<=nodeCount     (where n is an integer variable, n=0 to begin with, incremented by 1 thru each loop, nodeCount is # of DocumentReference nodes)
     I try retrieve to the orderId in the following expression shape using the below xpath query
      xpathQuery = System.String.Format("//*[local-name()='OrderReference'][{0}]/@orderID)",n);
      sOrderId = xpath(MsgSingleInvoice,xpathQuery);
    And I get the following exception:
    Inner exception: '//*[local-name()='OrderReference'][1]/@orderID)' has an invalid token.
    Exception type: XPathException
    Appreciate any help!   thanks!

    Thanks for the quick response. I got rid of it.
    And I see a different error:
    Inner exception: Specified cast is not valid. Exception type: InvalidCastException
    Source: Microsoft.XLANGs.Engine  
    Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type)
    Since variable 'n' is of integer type, I suspected it and changed it to n.ToString() and tested again and still see the same error.

  • Sum on child nodes based on attribute value in xslt

    Hi all,
    Any one can post helpful code to calculate the sum of child nodes based on the attribute value of other child node.
    Let's say for example.
    I have one child element has attribute value let's say Tax so I have to put condition on child element having value of "Tax" I need to calcualte sum of Invoice amount that element is also child node
    After calculating sum I have to apply that sum at the header level of the Invoice. For each Invoice I have calculate sum and apply at the header level.

    It isn't working :(.Got the following error:
    An error was reported compiling the XPath expression: error: XPath expression invalid, not a selection: declare namespace ws = 'http://www.bea.com/wli/sb/transports/ws';
    declare namespace tuxedo = 'http://www.bea.com/wli/sb/transports/tuxedo';
    declare namespace wsa = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
    declare namespace http = 'http://www.bea.com/wli/sb/transports/http';
    declare namespace xsi = 'http://www.w3.org/2001/XMLSchema-instance';
    declare namespace wsp = 'http://schemas.xmlsoap.org/ws/2004/09/policy';
    declare namespace file = 'http://www.bea.com/wli/sb/transports/file';
    declare namespace xsd = 'http://www.w3.org/2001/XMLSchema';
    declare namespace soap12-env = 'http://www.w3.org/2003/05/soap-envelope';
    declare namespace flow = 'http://www.bea.com/alsb/flow/transport';
    declare namespace sftp = 'http://www.bea.com/wli/sb/transports/sftp';
    declare namespace sb = 'http://www.bea.com/wli/sb/transports/sb';
    declare namespace soap-enc = 'http://schemas.xmlsoap.org/soap/encoding/';
    declare namespace ejb = 'http://www.bea.com/wli/sb/transports/ejb';
    declare namespace soap-env = 'http://schemas.xmlsoap.org/soap/envelope/';
    declare namespace jpd = 'http://www.bea.com/wli/sb/transports/jpd';
    declare namespace email = 'http://www.bea.com/wli/sb/transports/email';
    declare namespace tp = 'http://www.bea.com/wli/sb/transports';
    declare namespace dsp = 'http://www.bea.com/dsp/transport/sb';
    declare namespace ctx = 'http://www.bea.com/wli/sb/context';
    declare namespace soap12-enc = 'http://www.w3.org/2003/05/soap-encoding';
    declare namespace wsu = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd';
    declare namespace jms = 'http://www.bea.com/wli/sb/transports/jms';
    declare namespace ftp = 'http://www.bea.com/wli/sb/transports/ftp';
    fn:string(./xml-fragment/@IntObjectName).

  • How to get attribute value of a node

    Hi experts
    I have a mapped node in my view context from component controller context. This node consists of 2 value attributes inside
    Example:
    NODE1             -
    > Cardinality 1..1, seleciton 1..1
       -- x_date         -
    > type DATS
       -- x_years        -
    > dec3
    How do I get the attribute value attr1 and attr2 ??
    Here is my code in my view method
      DATA: lr_node_info TYPE REF TO if_wd_context_node_info,
            l_date       TYPE dats,
            l_xyears     TYPE i.
      lr_node_info = wd_context->get_node_info( ).
      lr_node_info = lr_node_info->get_child_node('NODE1').
       l_date       = lr_node_info->get_attribute( name = 'X_DATE' ).
       l_xyears     = lr_node_info->get_attribute( name = 'X_YEARS' ).
    It does not seems to work since it says < the result type of the function method can not be converted into the result type L_DATE>
    I try to understand why but not sucessful, please help and thank you for your kindness

    Hi Dean,
    Regading uour problem of reading the attributes value of the context node, you have to  use the code wizard. that ia avaliable on the top toolbar when you are inside the View Method
    There is option to read context  select that radio button option and then thru F4 help
    if you can select the node then Code is automatically generated with variable declaration.!!
    Like this :
      DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
        DATA lo_el_node1 TYPE REF TO if_wd_context_element.
        DATA ls_node1 TYPE wd_this->element_node1.
        DATA lv_x_date LIKE ls_node1-x_date.
        DATA lv_x_year LIKE ls_node1-x_year.   
      navigate from <CONTEXT> to <NODE1> via lead selection
        lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
      get element via lead selection
        lo_el_node1 = lo_nd_node1->get_element(  ).
      get all declared attributes
        lo_el_node1->get_static_attributes(
          IMPORTING
            static_attributes = ls_node1 ).
        lv_x_date = ls_node1-x_date.
        lv_x_date = ls_noe1-x_year.
    if you can select the attribute then Code is automatically generated with variable declaration.!!
    DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node1 TYPE REF TO if_wd_context_element.
      DATA ls_node1 TYPE wd_this->element_node1.
      DATA lv_x_date LIKE ls_node1-x_date.
    navigate from <CONTEXT> to <NODE1> via lead selection
      lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
    get element via lead selection
      lo_el_node1 = lo_nd_node1->get_element(  ).
    get single attribute
      lo_el_node1->get_attribute(
        EXPORTING
          name =  `X_DATE`
        IMPORTING
          value = lv_x_date ).
    Hopes this will helps you.
    Regard
    Manoj Kumar

  • Regd XSLT Mapping

    Hi All,
    I have a scenario where i need to use XSLT mapping, I would like you to provide docs/links from where i can get info abt XSLT mapping.
    Thanks in advance
    Shiva

    Hi Thomas,
    XSLT Mapping
    xpath functions in xslt mapping
    Design time Value-mappings in XSLT
    File to Multiple IDocs (XSLT Mapping)
    XSLT Mapping with java enhancement
    XSLT Mapping With JAVA Enhancement ( For Beginners)
    XSLT - Grouping  XML with XSLT  - From Muenchian Method To XSLT 2.0
    Dynamically sending a mail to the PO creator using XSLT- ABAP Mapping -
    Dynamically sending a mail to the PO creator using XSLT- ABAP  Mapping
    xpath functions in xslt mapping -xpath functions in xslt mapping
    Lookups with XSLT - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Using XSLT Mapping within the J2EE Adapter Framework -https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    Regards
    Goli Sridhar

  • Read a XML node value/attribute value from a CLOB

    Hello,
    I can write SQL/ - PL/SQL "straightforward" but now I have a problem what is to big for me.  I hop that someone can help.
    We create by code a xml structure and write these into the oracle database CLOB field. I'm sorry to say that a xml text structure is written into a clob in stead of a xmltype field. (it's a design failure?) It's a large xml structure. I believe I can't attach a file so I put at the end of this discussion a light example of the xml structure.
    It's a xml with quartervalue's, so there are 35040 detail rows (24h * 4 * 365days). I want to accumulate the the attribute Amount value 9. The amount value is in the Detail node a attribute but at the end you can see that for the DST are also 4 value's, but these are not attribute value's but node value's. (In this case it are four value's in some cases there is one DST amount value.
    Can somebody help me how to accumulate all the detail attribute value Amount with the node value Amount of the DST tag?
    XML structure:
    <?xml version="1.0"?>
    <Message xmlns:ns1="http://automaticdealcapture/">
        <BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
            <DocumentData>
                <ns1:Adcs>
                    <ns1:Package>
                        <ns1:Deal>
                            <ns1:ProductCode>PWCODE</ns1:ProductCode>
                            <ns1:Action>NEW</ns1:Action>
                            <ns1:Memo1>MemoField</ns1:Memo1>
                            <ns1:Details>
                                <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
                                <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
                                etc. 350040 detail rows.
                            </ns1:Details>
                            <ns1:DSTS>
                                <ns1:Year Val="2014">
                                    <ns1:DST Period="1">
                                        <ns1:Amount>0.0146</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="2">
                                        <ns1:Amount>0.0222</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="3">
                                        <ns1:Amount>0.0444</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="4">
                                        <ns1:Amount>0.0146</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                </ns1:Year>
                            </ns1:DSTS>
                        </ns1:Deal>
                    </ns1:Package>
                </ns1:Adcs>
            </DocumentData>
        </BusinessDocument>
    </Message>

    From what I know, extracting the "Amount" values in the Details section and the "Amount" values in the DSTS section would be two different SELECT statements.
    Both of these will use XMLTable() to extract the values.
    BTW - If you need more information on this, post up in the XML/XML DB forum section for more complex help.  (eg getting YEAR with the DSTS Amount values)
    as far as XML size goes, I've seen oracle handle a 100MB XML document without problems.
    (just understand, it will be 'slow')
    This one will give you the Amount values from the DSTS section:
    with xml_data as ( SELECT
    XMLType('<?xml version="1.0"?>
    <Message xmlns:ns1="http://automaticdealcapture/">
        <BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
            <DocumentData>
                <ns1:Adcs>
                    <ns1:Package>
                        <ns1:Deal>
                            <ns1:ProductCode>PWCODE</ns1:ProductCode>
                            <ns1:Action>NEW</ns1:Action>
                            <ns1:Memo1>MemoField</ns1:Memo1>
                            <ns1:Details>
                                <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
                                <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
                            </ns1:Details>
                            <ns1:DSTS>
                                <ns1:Year Val="2014">
                                    <ns1:DST Period="1">
                                        <ns1:Amount>0.0146</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="2">
                                        <ns1:Amount>0.0222</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="3">
                                        <ns1:Amount>0.0444</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                    <ns1:DST Period="4">
                                        <ns1:Amount>0.0146</ns1:Amount>
                                        <ns1:Price>33.333</ns1:Price>
                                    </ns1:DST>
                                </ns1:Year>
                            </ns1:DSTS>
                        </ns1:Deal>
                    </ns1:Package>
                </ns1:Adcs>
            </DocumentData>
        </BusinessDocument>
    </Message>') as XMLDATA from dual
    select Y.amount
    from xml_data X,
      XMLTable(  XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
       '/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:DSTS/ns1:Year/ns1:DST'
        passing X.XMLData
      COLUMNS
        amount Number PATH '/ns1:DST/ns1:Amount'
      ) Y;
    Replace the XMLTable() with the one below to get the Amount from the Details section:
      XMLTable(  XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
       '/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:Details/ns1:Detail'
        passing X.XMLData
      COLUMNS
        amount number PATH '/ns1:Detail/@Amount'
      ) Y;

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Fetch attribute value of structure node

    Dear All,
    Please let me know is it possible to get the attribute name and attribute value of a structure node of a record model inside the program?
    Can I give any name as the attribute name?
    Regards,
    Biju K George

    Hi,
    could you provide an example ?
    I think you speak about using field-symbol.
    --> get the attributes of a structure or a table --> same has field catalog for ALV
    --> get the value of the attributes :
    concatenante structure_mane attribute_name into w_field separated by '-'.
    assign (w_field) to <field>
    check <field> is assigned.
    and <field> is the value of the attribute attribute_name of the structure structure_name.
    regards
    Fred

  • XSLT Mapping of Adapter-Specific Message Attributes

    Hi,
    We have the requirement to build a soap request with a custom soap envelop/header which contains a sessionId.
    Therefore we developed a xlst mapping which is called directly after a graphical mapping.
    In the graphical mapping the session id is written to the dynamic configuration.
    The goal is to read this session id in the xslt mapping from the dynamic configuration using XSLT Mapping of Adapter-Specific Message Attributes. We used  [this|http://help.sap.com/saphelp_nwpi711/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm] documentation as an example.
    But we are getting the following error: TransformerConfigurationException triggered while loading XSLT mapping. The error is raised at this node: <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    This is the coding of the xslt transformation:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:ns1="urn:enterprise.soap.sforce.com"
          xmlns:map="java:java.util.Map"
          xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
          xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
    <soapenv:Header>
    <urn:SessionHeader>
    <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    <xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/SOAP', 'sessionId')" />
    <xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf, $dynamic-key)" />
    <urn:sessionId><xsl:value-of select="$dynamic-value"></xsl:value-of></urn:sessionId>
    </urn:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <xsl:copy-of select="*"/>
    </soapenv:Body>
    </soapenv:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    Any help will be highly appreciated.
    Regards, Henk

    Hi, yes we did try that and lot's of other combination.
    The results of those trials are that it seems to go wrong with <xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
    When we enclose it with <xsl:if test="function-available('map:get')"> the transformation is not dumping, but the function is not available.
    Regards, Henk

  • XSLT Mapping: Problem in appending xmlns attribute

    Hi
    This is my source message
    <?xml version="1.0" encoding="UTF-8"?>
    <soap-env:Envelope xmlns:soap-env= "http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
    <OrderID xmlns="http://dummyvalue">12345</OrderID>
    </soap-env:Body>
    My XSLT mapping
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">
    <soap-env:Envelope>
    <soap-env:Body>
    <OrderID>
    <xsl:attribute name = "xmlns" >
    <xsl:value-of select="@xmlns"/>
    </xsl:attribute>
    <xsl:text>12345</xsl:text>
    </OrderID>
    </soap-env:Body>
    </soap-env:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    I am getting the error message as
    ERROR: Description: The value of the 'name' attribute may not be 'xmlns'.
    Please help me how to append xmlns attribute in OrderID element ??

    Hi,
    Use <xsl:element> to create a node in the output and specify the namespace.
    <xsl:element
    name="name"
    namespace="URI"
    use-attribute-sets="namelist">  <!-- Content:template --></xsl:element>
    Thanks,
    Beena.

Maybe you are looking for

  • Multiple Apple ID's, which one should be main iCloud ID on iOS 5?

    Hey!  Seems like iCloud is a bit more complex to setup than I had thought it would be.  Here's the situation.  I have two Apple ID's.  One is my @me.com account that I just migrated to iCloud.  Second Apple ID is an @gmail.com account that I use for

  • My select query in not working

    hi this my select query select * from J_1IEXCHDR where werks = 'DT*' this is not working i want result where werks like DT01, DT09 and many statting with DT so plz tel me how to write for like . thank

  • G/L account picked for the "wrong" source system entry

    Dear Experts, in SRM 7.0, Classic Scenario, i am facing the following issue with respect to G/L account determination in the SC: We have three R/3 systems connected to SRM. All these R/3 systems use the same Material Groups, but the G/L accounts are

  • Accessing display values of a select list (or LOV)

    Hi all, I was asking myself if it is possible to access the display values of a select list (to be added to a report header and to the Head section of a pdf export), and to call them in form of the &xxxxx. notation e.g. if &P10_REGION. return the sel

  • Migration from MS SQL Server 7.0 to ORACLE 7.3

    I am unable to download WorkBench. Does it support the migration from MS SQL Server 7.0 to ORACLE 7.3 anyway.