IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
Expand all | Collapse all

Do we have any option to ignore the elements in xml file that are not defined in XSD/typetree.

  • 1.  Do we have any option to ignore the elements in xml file that are not defined in XSD/typetree.

    Posted Thu April 28, 2016 04:57 AM

    Originally posted by: DennisRitche


    Hi Team , 

    I generated a type tree with the XSD definition , but we do had a situation that when we receive data from the upstream there may be possibility to receive undefined elements(elements not defined in the xsd) in the xml file , for which in general map will be failed , but since the undefined elements will not be mapped further so we need to ignore those elements , here my question is do we have any option to ignore the elements  in incoming xml file that are not defined in XSD/typetree.

    FYI - I tried to use <any> property defining in the xsd but here in this case we cannot expect the position of the undefined elements in the incoming message receiving from the upstream , so this option will not fit in this case.

    To be more clear: I am searching for an option which would act similar to the java/IIB  in which we can dig into the xml file with xpath itself and extract the required fields.

    do anyone has any idea on this?

     

    Thanks,

    Dennis Ritche

     


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


  • 2.  Re: Do we have any option to ignore the elements in xml file that are not defined in XSD/typetree.

    Posted Fri April 29, 2016 03:09 AM

    Originally posted by: paul.brett


    You can activate the 'Well Formed' option on the input card, and NO validation will be performed, except checking that the data is valid XML.

    The XPATH() function is available in WTX/ITX.

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 3.  Re: Do we have any option to ignore the elements in xml file that are not defined in XSD/typetree.

    Posted Fri April 29, 2016 10:51 AM

    Originally posted by: DennisRitche


    Hi paul, 

    Thanks for the response ....! Idea

    I think the "well formed" option will ignore the restrictions/size validations that has been defined in XSD , right?

    Here i am talking about a case where there may be a possibility of receiving elements in xml which are not defined in xsd/typetree , does Well formed option valid in this case?

    Defining my case with an example:

    **************************************************************

    XSD:

    
    <xs:schema 
    attributeFormDefault
    =
    "unqualified" 
    elementFormDefault
    =
    "qualified" 
    xmlns:xs
    =
    "http://www.w3.org/2001/XMLSchema"
    >  
    <xs:element 
    name
    =
    "note"
    > 
    <xs:complexType> 
    <xs:sequence> 
    <xs:element 
    type
    =
    "xs:string" 
    name
    =
    "
    to"
    /> 
    <xs:element 
    type
    =
    "xs:string" 
    name
    =
    "
    from"
    /> 
    <
    /xs:sequence>   
    </xs:complexType>  
    </xs:element>
    </xs:schema>
    

    here only the two elements "to" and "from" are defined

    ********************************************************************************************

    XML:

    <note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>
    Don't forget me this weekend!</body>
    </note>

    here in xml two undefined elements have been received and the map should not throw error for this case since those will not be passed to downstream(i mean no mapping for these two elements)

    ********************************************************************

    Coming to the second option using XPATH:

    here in this case i am successful for some extent , but i am unable to handle the multiple occurrences situation , i mean a group(1:s) need to be mapped since the group occurrences is undefined , i cannot go with indexing , could we do in some other way? 

     


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