on 08-15-2007 11:57 AM
Hi ,
I have to split the string into different fields based on the delimiters. I guess i can use XSLT for this
my source format is
<ns:EDIFACT xmlns:ns="urn:ABG.com/EDI/Invoices">
<Recordset>
<KEY>
<Line>UNHCK66XINVOIC:D:93A:UN:EDIT30</Line>
</KEY>
</Recordset>
My target format should be
<ns:EDIFACT xmlns:ns="urn:ABG.com/EDI/Invoices">
<Recordset>
<KEY>
<Line>
<Element> UNH </Element>
<Element>CK66X</Element>
<SubelemtTitle> <Subelemt>INVOIC</Subelemt>
<Subelemt>D</Subelemt>
<Subelemt>93A</Subelemt>
<Subelemt> UN</Subelemt>
<Subelemt>EDIT30</Subelemt>
</SubelemtTitle>
</Line>
</KEY>
As you can see the delimiters are + for element and : for Subelement.
I thought using XSLT for this is a good option. But i am not an XSLT expert. Can any XSLT experts out there help me out
Thanks a lot
Thanks for your responses . i am using a Java UDF instead to achieve it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> As you can see the delimiters are + for element and
> : for Subelement.
you do FCC for this, right?
You could evalue one of the delimiters there (for example, +).
At mapping time, you would just have to handle the other one (, and that could be easily done with simple UDFs.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would suggest using a User Defined Function in mapping as opposed to XSLT.
You can use the Java 'String.indexOf()' method and 'String.substring()' method to get different elements. You can also use the StringTokenizer class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.