I have a xml file which has the following structure:
<Alignement ObjectId="9a8ed34d-2da9-4f37-9d5c-6569f665ce4f" Naam="R-HAVEN
SP.701" Status="onbekend" RevisieNummer="0" GroepId="b885abb4-e34d-40d0-a752-362869bf8667" Lengte="2134.04431" Start="0" Type="Alignement" IsSubcomponentenDoorgerekend="true">
<CombiPuntenHorVer>
<SpoorasInfoPunt ObjectId="0c131e39-de81-4244-905f-e7f27057566d" GroepId="7e1bd81b-0ce3-4144-947b-b095b5020b53" offset="0" Spoorzijde="Links" Bulgefactor="0" z_verkanting="0" dY_verkanting="0" factor="0" hoek_XY="0" hoek_YZ="0" Min_R_Horizontaal="0" Metrering="0">
<Geometrie>
<CoordinaatSysteem>
<Locatie KeuzeCSType="Rijksdriehoek" X="145146.355" Y="345251.230" Z="3.5"/>
</CoordinaatSysteem>
</Geometrie>
</SpoorasInfoPunt><SpoorasInfoPunt ObjectId="9021e8e2-4599-45c6-9b16-9f3418545aab" GroepId="7e1bd81b-0ce3-4144-947b-b095b5020b53" offset="0" Spoorzijde="Links" Bulgefactor="0" z_verkanting="0" dY_verkanting="0" factor="0" hoek_XY="0" hoek_YZ="0" Min_R_Horizontaal="0" Metrering="16.795950366832663">
<Geometrie>
<CoordinaatSysteem>
<Locatie KeuzeCSType="Rijksdriehoek" X="145146.455" Y="345251.330" Z="3.4"/>
</CoordinaatSysteem>
</Geometrie>
</SpoorasInfoPunt>.......
</CombiPuntenHorVer>
</Alignement>
Within the CombiPuntenHorVer element there can be numerous SpoorasInfoPunt elements
I'm trying to make a xfMap file which translates this structure into one polyline.
So when I have lets say 50 SpoorasInfoPunt elements in a CombiPuntHorVer element in a Alignement element it will create an Alignement record with all the attributes from the Alignement and a polyline shape which has 50 vertices (each vertice is a SpoorasInfoPunt).
can somebody give me a clou how to do this.
here is the xfmap file I created but it doesn't work:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xfMap SYSTEM "xfMap.dtd">
<xfMap type="Spoorlayout">
<schema-type>
<scan scan-empty-attributes="true"/>
</schema-type>
<!-- Spoorlayout -->
<feature-map>
<mapping match="Alignement">
<apply-attribute-sets>
<attribute-set>
<attributes>
<attribute>
<name><literal expr="Alignement_Id"/></name>
<value><extract expr="@ObjectId"/> </value>
</attribute>
<attribute>
<name><literal expr="Naam"/></name>
<value><extract expr="@Naam"/></value>
</attribute>
<attribute>
<name><literal expr="Status"/></name>
<value><extract expr="@Status"/></value>
</attribute>
<attribute>
<name><literal expr="RevisieNummer"/></name>
<value><extract expr="@RevisieNummer"/></value>
</attribute>
<attribute>
<name><literal expr="GroepId"/></name>
<value><extract expr="@GroepId"/></value>
</attribute>
<attribute>
<name><literal expr="Lengte"/></name>
<value><extract expr="@Lengte"/></value>
</attribute>
<attribute>
<name><literal expr="Start"/></name>
<value><extract expr="@Start"/></value>
</attribute>
<attribute>
<name><literal expr="Type"/></name>
<value><extract expr="@Type"/></value>
</attribute>
<attribute>
<name><literal expr="IsSubcomponentenDoorgerekend"/></name>
<value><extract expr="@IsSubcomponentenDoorgerekend"/></value>
</attribute>
</attributes>
</attribute-set>
</apply-attribute-sets>
<geometry activate="xml-line"></geometry>
</mapping>
</feature-map>
<feature-content-map>
<mapping match="SpoorasInfoPunt">
<geometry>
<data name="x">
<extract expr="./Geometrie/CoordinaatSysteem/Locatiei@X]"/>
</data>
<data name="y">
<extract expr="./Geometrie/CoordinaatSysteem/Locatiei@Y]"/>
</data>
<data name="z">
<extract expr="./Geometrie/CoordinaatSysteem/Locatiei@Z]"/>
</data>
</geometry>
</mapping>
</feature-content-map>
</xfMap>