|
Rank: Newbie
Joined: 8/31/2016 Posts: 3 Location: New Jersey
|
Hi, I have an xml file :
example : (input) <HCO> <ID>ABC</ID> <SP> <Address>Loc1 </Address> <Address>Loc2 </Address> </SP> </HCO>
I want the output to be something like this (flatten) :
<output> <id> <value>ABC</value> <address1>Loc1</address1> </id> <id> <value>ABC</value> <address2>Loc2</address2> </id> </output>
I have looked at flattenHierarchy.mfd that comes with Mapforce example. But I don't think that's something I need to do. Since I am not concating strings together.
NOTE: I am very new to MapForce world. Please provide as much details as you can. Thank you in advance.
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi,
see attached mapping example which uses the new functionality Show Child Elements with Dynamic Name available in the latest version of Mapforce (2017) to generate "address1" , "address2" etc in the target component of your mapping.
P.S You have posted this question in the wrong forum i.e. the Mapforce forum would be the correct forum for Mapforce specific questions.
File Attachment(s): test.zip (3kb) downloaded 970 time(s).
island attached the following image(s):
|
|
Rank: Newbie
Joined: 8/31/2016 Posts: 3 Location: New Jersey
|
Thank you island.
Unfortunately, I have Altova MapForce Enterprise Edition 2016 Release 2 SP1 version downloaded. And It's enterprise use. We still don't have 2017 version tested and approved for internal use.
So. is there any other alternative that I can use for 2016 version ?
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi kshah108,
no, there is no way to generate dynamically named output elements in this way using pre 2017 versions of Mapforce. If however you can settle with the address number appearing in an attribute of an element named "address" (as in the code snippet below), then you can do this with your version of Mapforce.
Code:
<?xml version="1.0" encoding="UTF-8"?> <output xsi:noNamespaceSchemaLocation="file:///C:/test/out.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <id> <value>ABC</value> <address number="1">Loc1</address> </id> <id> <value>ABC</value> <address number="2">Loc2</address> </id> </output>
File Attachment(s): test.zip (3kb) downloaded 1,062 time(s).
island attached the following image(s):
|
|
guest |