Skip to main content
Question

write xml elements only if a feature attribute has a value

  • November 19, 2020
  • 0 replies
  • 11 views

nicolae.soare
Participant
Forum|alt.badge.img+3

hello,

I am trying to write inside an xml file elements only if a feature attribute has a value.

I have 2 shp files :

In first file I have "Eticheta" feature with names of the street.

In second file I have "label" feature with attributes values are the same as "Eticheta " from the first file. Here, in the second file I have also "NR" which.

 

I am trying to write in XML numbers for streets and I need to write the numbers on each street.

I used an if-then-else statement that writes out the numbers only if street from first file is exactly like street from second file.

 

in my XMLTemplate, in subtemplate I have:

 

{ if( fme:has-attribute({fme:get-attribute("label")}) eq fme:has-attribute({fme:get-attribute("Eticheta")}) )

 

then

 

{fme:process-features("ADRESA")}

 

but fails to write data inside xml file.

errors from log:

XMLTemplater (XMLTemplaterFactory): An error occurred while parsing the 'ADRESE' sub-template

XMLTemplater (XMLTemplaterFactory): A fatal error has occurred. Check the logfile above for details

XMLTemplater (XMLTemplaterFactory): A fatal error has occurred. Check the logfile above for details

A fatal error has occurred. Check the logfile above for details

 

Can you please help me with this issue?

Thank you.

Nicu

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.