on 05-23-2012 12:21 PM
Hi Group,
In PI we are generating the below Output XML file,but our vendor is expecting in differen XML format,can any body suggest how we can conver this in PI:
PI Output
------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<RACTS>
<RACT>
<ACTID>123456789</ACTID>
<NAPM>
<MPANID>7712342</MPANID>
<ATERS>
<ATER>
<RLG>0.15</RLG>
<RUR>0.15</RUR>
<RLI>0.15</RLI>
<ARM>0.15</ARM>
</ATER>
</ATERS>
</NAPM>
<\RACT>
<\RACTS>
Expecting output
-----------------------------
<?xml version="1.0" ?>
<RACTS>
<RACT>
<ACTID="123456789"</ACTID>
<NAPM>
<MPANID="7712342"</MPANID>
<ATERS>
<ATER name="RLG">0.15,</ATER>
<ATER name="RUR">0.15</ATER>
<ATER name="RLI">0.15</ATER>
<ATER name="ARM">0.15</ATER>
</ATERS>
</NAPM>
<\RACT>
<\RACTS>
AlsoIN PI output we are getting we are getting two exta spaces in the first row before "<?xml version="1.0" encoding="UTF-8" ?> ", how to delete that two extra spaces.Pleas can any body help
Hi Rajiv,
I think the biggest problem is that you must convert elements in attributtes:
<RLG>0.15</RLG> ----> <ATER name="RLG">0.15,</ATER>
If the attributes will be always the same, it's possible to do with an XSL, but if the attributtes could change it will be difficult with xsl. Are the tags that are going to be "attributed" determinated, like always <RLG>, <RUR>, etc and no more?
Finally i think these tag are incorrect, What will be the correct?:
<ACTID="123456789"</ACTID>
<MPANID="7712342"</MPANID>
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it should rather be:
<ACTID attribute_name="123456789"/>
<MPANID attribute_name="7712342"/>
Or even like that:
<RACTS>
<RACT ACTID="123456789">
<NAPM MPANID="7712342">
<ATERS>
<ATER name="RLG">0.15,</ATER>
<ATER name="RUR">0.15</ATER>
<ATER name="RLI">0.15</ATER>
<ATER name="ARM">0.15</ATER>
</ATERS>
</NAPM>
</RACT>
</RACTS>
You can achieve this exactly the same way: define the attribute in Data Type, then map the value normally as for a field/node.
Regards,
Greg
Hi,
To change the XML structure:
1. In Data Type definition, place the cursor on the ATER field and click the "Add" button and choose Insert Attribute, type "name" as the name.
2. In Message Mapping, use Duplicate Subtree to create four copies of the ATER node, map the constants to the name attribute and the corresponding value to the ATER node itself.
About those spaces, there are a few possibilities. If you are using any other mapping than the graphical one, you might be adding it accidentally. It might also be only a matter of how PI displays it in moni - you can try checking the actual file content.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which mapping technique are you using? if you are using XSLT then you can edit your mapping accordingly
refer below link(dall replies and implement AMith logic..to remove spaces).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.