cancel
Showing results for 
Search instead for 
Did you mean: 

One File Adapter, many xml types

Former Member
0 Kudos

Hi,

I have to use file sender adapter to read files from a directory. The files are in XML format. Each file has a different XML structure and I can not distinguish by the name file the type of XML that goes into the file. How can I do that ?.

Thanks.

Best regards

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Francisco,

hopefully you solved the issue already, but maybe someone else has the same issue.

I just faced the same challenge.

In my scenario the all message types have the same receiver but different inbound interfaces and mappings should be used.

I solved it by checking the root element with a xpath content based routing in the interface determination.

It's important that you register the different namespaces used by the message types and then just insert the root element name and as compare operation select EX

In my sample I have to deal with two message types which use different namespaces.

message type1 eCH-0020:delivery xmlns:eCH-0020="http://www.ech.ch/xmlns/eCH-0020/2"

message type2 eCH-0078:eventReport xmlns:eCH-0078="http://www.ech.ch/xmlns/eCH-0078/2"

Therfore I inserted both namespaces in the table of the expression editor

prefix eCH-0020     namespace http://www.ech.ch/xmlns/eCH-0020/2

prefix eCH-0078     namespace http://www.ech.ch/xmlns/eCH-0078/

the value of the prefix is up to you, I decided to use descriptive namespaces

and then insert follwing XPATH expressions

/eCH-0078:eventReport  EX

/eCH-0020:delivery EX

that's it

hope this helps.

Best regards,

Jochen

Former Member
0 Kudos

Hey

as u have different XML structures,then either u wont be using any IR objects or u will have separate IR objects for all of them.

if u have different IR objects for all of them,then simple differentiate them based upon their name

thanx

ahmad

MichalKrawczyk
Active Contributor
0 Kudos

hi,

1. create a simple adapter module that will just check the structure of the file

and put some info about it in dynamicheader

2. in receiver determination use this dynamicconfiguration info

to route to correct receiver (mapping)

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

bhavesh_kantilal
Active Contributor
0 Kudos

Only option is to use a Java or XSL mapping , try to determine what the XML strcuture actually is and then create the target strucutre.

Regards

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can use standard message mapping with my solution I believe

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

bhavesh_kantilal
Active Contributor
0 Kudos

Michal,

I thought abt this as well, but , doesnt the receiver determination validate the Schema of the Source XML?

You will be using Context Objects and so shouldnt this imply that the output of the Module confirms to one particular XML format?

Regards

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>I thought abt this as well, but , doesnt the receiver determination validate the Schema of the Source XML?

validate in XI ?

Regards,

michal