Skip to main content

Hallo community! I want to give you some vision about my try to create an xml document with the "XMLTemplater". The problem in my workflow is that i can't create an variable in one subtemplate to read it in an other subtemplate. (second picture show what i mean with subtemplate). Thats why i can't fill the right geometry information into my structure because my subtemplate "GEOMETRY" doesn't know in which road he is and so he can't get the right nodes out of a list which includes all nodes.

So my question is now which possible ways do i have to solve that problem or how to create the xml-file with an defined structure over an other way (not over an "XMLTemplater") ?

Hi,

I cannot see the templates, my best guess is that you want a single XML with multiple "ROAD"s as sub-elements and each ROAD sub-element has multiple vertices.

In XMLTemplater you can nest Sub Templates. Eg:

If you use use in ROOT:

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

you can use in the ROAD template:

 

{fme:process-features("GEOMETRY", "COUNTER_2_ATTR", fme:get-attribute("COUNTER_2_ATTR"))}

COUNTER_2_ATTR is the Count Output Attribute that you set in the Counter_2 transformer.

Is it something you wanted to achieve?


It's hard to find a solution unless attributes which the input features have and the XML schema you need to create from them would be clarified. Could you please elaborate the conditions and the requirements specifically?

 

 


Hi,

I cannot see the templates, my best guess is that you want a single XML with multiple "ROAD"s as sub-elements and each ROAD sub-element has multiple vertices.

In XMLTemplater you can nest Sub Templates. Eg:

If you use use in ROOT:

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

you can use in the ROAD template:

 

{fme:process-features("GEOMETRY", "COUNTER_2_ATTR", fme:get-attribute("COUNTER_2_ATTR"))}

COUNTER_2_ATTR is the Count Output Attribute that you set in the Counter_2 transformer.

Is it something you wanted to achieve?

Thats exactly what i need. It just looks like a matlab function which i can give parameters with it.

 

Thanks!

 


Hi,

I cannot see the templates, my best guess is that you want a single XML with multiple "ROAD"s as sub-elements and each ROAD sub-element has multiple vertices.

In XMLTemplater you can nest Sub Templates. Eg:

If you use use in ROOT:

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

you can use in the ROAD template:

 

{fme:process-features("GEOMETRY", "COUNTER_2_ATTR", fme:get-attribute("COUNTER_2_ATTR"))}

COUNTER_2_ATTR is the Count Output Attribute that you set in the Counter_2 transformer.

Is it something you wanted to achieve?

Can you also show me where and how i have to define the variable "Counter_2_ATTR" ?

 

Is that like:

 

Definition:

 

COUNTER_ROAD := @Count("road") 
give the variable like a parameter to my subtemplate "GEOMETRY":

 

{fme:process-features("GEOMETRY","COUNTER_ROAD",fme:get-attribute("COUNTER_ROAD")} 
But i think i can't declare and use the variable in the same subtemplate "ROAD". So that means that i should split the declaration and the hand over to "GEOMETRY" is that right ?

 


Can you also show me where and how i have to define the variable "Counter_2_ATTR" ?

 

Is that like:

 

Definition:

 

COUNTER_ROAD := @Count("road") 
give the variable like a parameter to my subtemplate "GEOMETRY":

 

{fme:process-features("GEOMETRY","COUNTER_ROAD",fme:get-attribute("COUNTER_ROAD")} 
But i think i can't declare and use the variable in the same subtemplate "ROAD". So that means that i should split the declaration and the hand over to "GEOMETRY" is that right ?

 

Please read @revesz's answer more carefully.

 

"COUNTER_2_ATTR is the Count Output Attribute that you set in the Counter_2 transformer."

 


Reply