on 09-01-2009 10:08 AM
Hi Experts,
I have been thinking this since long that how XI will read XML file and map it to target message? The scenario is File to File. The source file is in XML format given by third party. I want to convert this file in some other XML format and put it in the target filesystem. Third party has given only XML file and they do not have XSD for it.
The file Structure contains around 24 segments. So for test we can think of below structure.
<R>
<MR1/>
<MR2/>
<MR3/>
<MR4/>
</R>
<Q>
<MQ1/>
<MQ2/>
</Q>
I am not concerned about mapping. Please tell me how should I create IR part for the source message and in runtime how will it work. We need to keep in mind that hird party can not make any changes to its XML file and we also need to follow our XI/PI naming conventions.
Had this been the simple text file, I would have specified this structure manually in IR and used the FileContentConversion to convert plain text to XML. But since we are directly getting XML, how should we create DT and MT for it?
Please revert if I am not clear.
Br,
Nilz
>>> I would have specified this structure manually in IR and used the FileContentConversion to convert plain text to XML. But since we are directly getting XML, how should we create DT and MT for it?
Procedure is same even if you get text file or XML file. If third party is not providing any xsd then you have to create the DT & MT manually. Only the difference is in case of txt you have to do FCC and in case of XML you don't.
--Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Suraj and Sarvesh. If I will create my DT and MT manually, I would follow XI naming convention i.e. the format would be
<MT_MTRREAD>
<Structure Pasted in Original Question>
</MT_MTRREAD>
But the third party can not change their XML file and add root nodes <MT_MTRREAD> and also the namespace which we give in XI.
In that case, the file structure would be different than what is being sent. Ii will not work in runtime? Correct? What is the workaround?
Br,
Nilz
Don' worry abt namespace it can be taken care. If you don't want the namspace then simply delete it from your target Message Type from 'XML Namespace'.
As abhishek said is correct you can create DT & MT without naming conventions But one thing that you have to keep in mind is you to take care of CASE. So create the tags as per the case sensitivness given in your source xml.
--Sarvesh
Thank you all for the response. So that means, in any case I will need to create XSD myself.
To keep naming conventions in place, I can import it as External Definition. Else it can be a Normal DT MT object. About NameSpace problem, I can remove namespace from MT.
At runtime will it create any issues if I will not give namespace? In ID, Receiver Determination, Interface Determination, Sender Agreement would be without namespace? Am I right?
Br,
Nilz
Hi Niz,
>>At runtime will it create any issues if I will not give namespace? In ID, Receiver Determination, Interface Determination, Sender Agreement would be without namespace? Am I right?
Did you meant binding the namespace with External definition or MT. If yes, then this will not create any problem in ID
and all your other objects :
1. Target DT, MT, MI
2. Source MI and external Definition
3. Message and Interface Mapping
will have their own namespaces.
Regards
Suraj
Hi Sarvesh,
I am not worrying about the namespace on target side. While creating Sender MT, I do not want to give namespace because the Source File does not contain any namespace. Does this create any problem? And will it work?
I will create sender DT/MT Structure as per the Source File. The MT name will be the name of the root element from the source file. But we will need to keep in mind that the Source File will not have any namespace as well. And having NS in MT will create problem? Isnt it?
br,
Nilz
Hi Nilz,
>>I will create sender DT/MT Structure as per the Source File. The MT name will be the name of the root element from the source file. But we will need to keep in mind that the Source File will not have any namespace as well. And having NS in MT will create problem? Isnt it?
If you create DT and MT for Source side
1. you might not be adhering for Naming convention.
2. To remove XML Namepsace from the structure keep the XML Namespace enty in MT as blank.
Regards
Suraj
absence of the prefix ns wont cause any harm.
Removing the namespace reference from the Message Type (in IR) will solve the problem of namespace not occuring.
Just the element names and structure (hierarchy) should be maintained.
1. you might not be adhering for Naming convention.
Adhering to naming convention is nowhere specified as compulsory......ultimately the development is to be created keeping in mind the runtime data and business needs.
Regards,
Abhishek.
Edited by: abhishek salvi on Sep 1, 2009 4:44 PM
> I am not worrying about the namespace on target side. While creating Sender MT, I do not want to give namespace because the Source File does not contain any namespace. Does this create any problem? And will it work?
No it will not create any problems at all and it will work. Simply delete the namespace from both source ans target MT.
> I will create sender DT/MT Structure as per the Source File. The MT name will be the name of the root element from the source file. But we will need to keep in mind that the Source File will not have any namespace as well. And having NS in MT will create problem? Isnt it?
As soon as you will remove the namespace from your MT, NS will disappier from your source automatically. Just confirm this out in your MM under test tab by pressing the SRC button.
--Sarvesh
Hi Niz,
As mentioned by Krish, there is only two option:
1. Create teh structure yourself (DT, MT)
2. else create XSD from XML. You can use this online link http://www.flame-ware.com/products/xml-2-xsd/. This is not as simple as it looks, since after you make the XSD you need to be able to import it into XI. Before that I will suggest you to use XMLSpy and validate your XSD. Once all minute changes are doen you can import the structure as an external definition in XI.
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Because the third party has not given you the XSD, you need to generate it one using tools like XMLSPY and other XSD generator tools.
It would be rather difficult to upload the source without XSD.
Regards
Krish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how to conver XSD??
its very simple ...
answer here
download XML spy (search in google 30 days free taril available dowload it).then sleect new in XML spy and paste your XML file , then go to DTD/SHEMA in XML spy tab,then select genarate XSD .
if you want to chnage occurace , the edit XSD add minoccurs max occurs.
cheers,
raj
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.