Skip to Content
avatar image
Former Member

XML into one field

Hi , we have a scenario where we have to move entire source structure into one of the fields of the target structure.

Example:

Source:

item1

description

store

storedescription

price

batch

Target:

item1

store

xmlstring

we would like to do following mappings:

1. item1 in source to item1 in target

2. store in source to store in target

3. entire source structure in XML format into xmlstring in target

we reffered following blog , but couldnt map to our requirement.

/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

XML to single element: Attn: Henrique

Thanks,

Rajesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 15, 2008 at 10:34 AM

    Go for java mapping. There u can pass the entire xml to a field as a string using the dom parsing

    Regards,

    Prateek

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 15, 2008 at 10:42 AM

    HI

    I think you need to write UDF for this. there is library from apache called XML Serializer. Below is the sample file how you achieve that using that. Use that code in your UDF.

    http://www.informit.com/articles/article.asp?p=31349&seqNum=3&rl=1

    Even just concatenate into one field in the target during mapping and the send the data . this could also achive your requirments. no need to go for Java mapping

    thanks

    Swarup

    Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM

    Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Swarup,

      it looks like this program is creating XML segments manually by giving segment names. In our scenario, idoc structures are bit complex, it might not be possible to ccreate like this.