IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
  • 1.  XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Thu December 29, 2011 10:41 AM

    Originally posted by: SystemAdmin


    Hello,

    We face a little problem with the WTX namespace processing for inner elements.

    We use custom schemas made up of imported standard schemas (sepa, swift MX) and one of our client wants to receive
    his xml files whose namespace declarations are not made in the root tag (and then referenced with prefix in the corresponding tag) but in an inner element with a default namespace declaration (like "<Header xmlns="urn.header>...").

    I know that WTX can process input files like this but I did not find the way to produce them.

    I've joined a map which copies its xml input to its output without any modification (same TypeTree used both in input and output).

    In my input file the element '*<Header xmlns="urn.header">...*' is turned into '*<head:Header>...*' and the NS declaration '*xmlns:head="urn.header"*' has been added to the root tag.

    This creates a perfectly valid xml file but it does not fit our cients wish.

    I need to produce a file similar to the input file.

    I know that in classic mode, all the element have an optional attribute xmlns which allows to specify a namespace for a particular element but I have to work in Xerces mode.

    Do you know how I could achieve this in Xerces mode?

    Rgrds,
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Fri January 06, 2012 03:58 AM
      |   view attached

    Originally posted by: paul.brett


    I have modified the map to create the following output:

    <?xml version="1.0" encoding="UTF-8"?>
    <Message xmlns="urn.header">
    <Header>
    <Sender>
    <BIC>My BIC CODE</BIC>
    <IBAN>My IBAN</IBAN>
    </Sender>
    </Header>
    </Message>

    It was a simple matter of removing the word 'head' from the Namespace declaration (urn.header) from the output card properties.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)



  • 3.  Re: XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Fri January 06, 2012 05:14 AM

    Originally posted by: SystemAdmin


    Hello Paul,

    Thank you for your answer but this is not what I want to achieve.

    I do not want that the namespace declaration in the root element but in the associated element.

    In my example, I want the "urn.header" declaration inside the header element and not inside the Message element.

    Something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <Message>
    <Header xmlns="urn.header">
    <Sender>
    <BIC>My BIC CODE</BIC>
    <IBAN>My IBAN</IBAN>
    </Sender>
    </Header>
    </Message>

    I know this is possible in classic mode but I could not find any mean to do it in Xerces mode.

    Rgrds,

    Julien
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Wed April 12, 2017 03:22 AM

    Originally posted by: 40S8_Ankita_Choudhary


    Hi hermann,

    I have a similar query.

    How can we add xml declaration(<?xml version="1.0" encoding="UTF-8"?>) to a xml using WTX? 
    Input- 
    <note> 
    <to>Tove</to> 
    <from>Jani</from> 
    <heading>Reminder</heading> 
    <body>Don't forget me this weekend!</body> 
    </note> 
    Expected output- 
    <?xml version="1.0" encoding="UTF-8"?> 
    <note> 
    <to>Tove</to> 
    <from>Jani</from> 
    <heading>Reminder</heading> 
    <body>Don't forget me this weekend!</body> 
    </note> 

    Is there anyway we can create dpa file(which can be used in IBM datapower XI50) to do the same? 

    Thanks in advance.:) 


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Mon April 17, 2017 04:45 PM

    Originally posted by: DeM0n


    I am not sure about data power but this can be done by mapping "Decl Prolog" of the XML type tree in the WTX map...


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: XML - Adding default Namespace declaration to inner element in Xerces mode

    Posted Tue April 18, 2017 04:03 AM

    Originally posted by: 40S8_Ankita_Choudhary


    Thanks for helping.

    I got proper response by setting the same.


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender