cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XSLT split string by delimiters

Former Member
0 Likes
541

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

View Entire Topic
henrique_pinto
Active Contributor
0 Likes

> 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.