Hello Everyone, I have a field which contains table and column name together for Foreignkey using (,) and (#) seperators. I have created also List on this field already, now i am not understanding how I can make another list for getting those values.
Now my result XML is looking like :
bnr:table > element is getting all the table and column names now, but i want to see my XML as follows:
A partial coding of my XML template is as follows:
<bnr:MD_DataSchema>
{
let $n := xs:integer(fme:get-attribute("_element_count")) - 1
for $i in (0 to $n)
let $aname := "_list_name{"||$i||"}.Spalte"
let $atype := "_list_name{"||$i||"}.Datentyp"
let $descrip := "_list_name{"||$i||"}.Beschreibung"
let $fkey := "_list_name{"||$i||"}.Tabellenbeziehung"
let $mval := "_list_name{"||$i||"}.Fehlende_Werte"
return
{
if (not(fme:get-attribute($aname) eq "")) then
<bnr:column>
<bnr:MD_Column>
<bnr:tableName>
<gco:CharacterString>v140_mun.dbo.{fme:get-attribute("Tabelle")}</gco:CharacterString>
</bnr:tableName>
<bnr:name>
<gco:CharacterString>{fme:get-attribute($aname)}</gco:CharacterString>
</bnr:name>
{
if (not(fme:get-attribute($descrip) eq "")) then
<bnr:description>
<gco:CharacterString>{fme:get-attribute($descrip)}</gco:CharacterString>
</bnr:description>
else(<bnr:description>
<gco:CharacterString>No description</gco:CharacterString>
</bnr:description>
)
}
<bnr:dataType>
<gco:CharacterString>{fme:get-attribute($atype)}</gco:CharacterString>
</bnr:dataType>
{
if (not(fme:get-attribute($mval) eq "")) then
<bnr:missingValue>
<gco:CharacterString>{fme:get-attribute($mval)}</gco:CharacterString>
</bnr:missingValue>
else(<bnr:missingValue>
<gco:CharacterString>No Missing Value</gco:CharacterString>
</bnr:missingValue>
)
}
{
if (not(fme:get-attribute($fkey)eq "")) then
<bnr:foreignKey>
<bnr:MD_ForeignKey>
<bnr:identifier>
<gmd:MD_Identifier>
<gmd:code>
<gco:CharacterString></gco:CharacterString>
</gmd:code>
</gmd:MD_Identifier>
</bnr:identifier>
<bnr:table>
<gco:CharacterString>{fme:get-attribute($fkey)}</gco:CharacterString>
</bnr:table>
<bnr:column>
<gco:CharacterString></gco:CharacterString>
</bnr:column>
</bnr:MD_ForeignKey>
</bnr:foreignKey>
else ()
}
</bnr:MD_Column>
</bnr:column>
else ()
}
}
Best answer by takashi
View original