IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Flattening with Mapforce Options · View
kshah108
Posted: Wednesday, October 19, 2016 3:56:16 PM
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.
island
Posted: Wednesday, October 19, 2016 4:33:07 PM
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):
dynamic _names.png

kshah108
Posted: Wednesday, October 19, 2016 8:16:58 PM
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 ?

island
Posted: Thursday, October 20, 2016 6:39:40 AM
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):
posattribute.png

Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.