IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
Expand all | Collapse all

Merged input XML's in one file

  • 1.  Merged input XML's in one file

    Posted Fri February 19, 2016 06:34 AM

    Originally posted by: Ole Haavard Haug-Larsen


    Hi.

    I have a file with several logical XML-files merged together as one input file. The typetree is defined with a 'File-level' as top-level where the DOC-level are repeated unlimited under the top-level.

     

    When I run the mapping I get the error: TYPE X'0002' (Error (-1), "XMLParser: Input XML data is invalid."

     

    How do I fix this? Any suggestions??

    Can I turn the XML-validation completely off?? (not only set xerces to 'well formed')??


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


  • 2.  Re: Merged input XML's in one file

    Posted Mon February 22, 2016 04:39 AM

    Originally posted by: @vkprasad_WTX


    Hi

    If you open the type tree and edit the properties of the DOC element. In the properties there is a field that has the dtd listed that you created the tree from. Make sure the correct path is in there. It defaults to just the filename of the dtd/xsd and for that to work, the dtd/xsd must be in the same directory as the map. Otherwise you will need to put the full path to the dtd/xsd for it to work from its existing location.


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


  • 3.  Re: Merged input XML's in one file

    Posted Tue February 23, 2016 03:27 AM

    Originally posted by: paul.brett


    You cannot use a Typetree that is defined from an XML metadata flie (XSD / DTD) to read non-XML data.

    I recommend you create a simple repeating textblob Typetree with appropriate delimiters defined so as to capture each full XML file into 1 object (such as the closing XML tag).

    Once you have this, you can then use the PARSE() function on the output.

    I will work on an example.

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 4.  Re: Merged input XML's in one file

    Posted Tue February 23, 2016 04:01 AM
      |   view attached

    Originally posted by: paul.brett


    See enclosed an example.

    Test1.mms contains a simple mapping of Input1.xml to Output1.xml

    TestAll.mms is a way of mapping Input.txt (which is a concatenation of Input1.xml, Input2.xml and Input3.xml) into a simple repeating group, which is then split on output using the PARSE() function.

    Further output cards can then be defined to read and map the individual XML elements.

    Thank-you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    Non-XML.zip   23 KB 1 version