IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
  • 1.  Remove invalid characters for XML Output

    Posted 03/05/08 08:32 AM

    Originally posted by: snutakki


    Hai,

    I am creating a XML file from a X12 - 830 .
    The customer is sending some unprintable characters and LATIN characters in the data and since these characters will make the XML file invalid I need to remove them.

    I need to remove any characters btw 0-31 and 128-255 per the below note from customer.

    According to the W3C, valid ASCII characters are 32-127. Most of the ASCII characters between 0-31 and 128-255 are invalid with the following three exceptions;

    o 9

    o 10

    o 13
    I know that i can use the SUBSTITUTE function and remove these characters, i was trying to see if there was a easier way than that to remove these characters any help is greatly appreciated.

    thanks,
    cai
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Remove invalid characters for XML Output

    Posted 03/05/08 09:26 AM

    Originally posted by: Kepa_Screen


    Hi,

    what version of DSTX are you using?
    If you are using a version higher than 7.5 you must create the type tree importing from a DTD.

    The easiest way to go is using XMLSpy from altova, in order to create a DTD from the XML file.
    First, you open the xml document, then go to DTD/Schema menu, and hit "Generate DTD".

    Then, when you have the DTD for that XML file, you must import from DTD at Type Designer, in order to create the type tree. You can see that Type Tree has some rules just for converting those characters like '&', '>', '<

    Also you must use for XML file at header, encoding 'ISO-8859-1' or 'ISO-8859-15'

    Think this may help. Good luck.

    Message was edited by: Kepa
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Remove invalid characters for XML Output

    Posted 03/05/08 09:30 AM

    Originally posted by: snutakki


    You have completely misunderstood my question, my question is on how to avoid Invalid XML characters being passed to the XML document which is my output.

    thanks,
    cai
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Remove invalid characters for XML Output

    Posted 03/05/08 09:44 AM

    Originally posted by: Kepa_Screen


    It would be the same.
    If you use DTD import at Type Designer, you will get a .mtt file that has a lot of "restriction rules".

    These restriction rules will do the job for you, converting undesirable characters to their desirable ones.

    If you want to put '>' then it will convert this character from > to "& gt ; " ( without spaces ) .
    We are working with XML output and this is the easiest way to go.

    Open XML file at XMLSpy -> Generate DTD from XML -> Import DTD at Type Designer.

    Message was edited by: Kepa

    Message was edited by: Kepa
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Remove invalid characters for XML Output

    Posted 03/05/08 01:16 PM

    Originally posted by: snutakki


    When we import the it will not have all the restrictions that i need.
    the restriction list that mercator creates by default is very limited.

    thanks,
    cai
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: Remove invalid characters for XML Output

    Posted 03/06/08 07:06 AM

    Originally posted by: Kepa_Screen


    Then you must put your concrete restrictions on output card or just use SUBSTITUTE function at your rules.

    I think that the easiest way is the first one, using concrete restrictions at output card.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender