Skip to main content
Question

Using GML in the XMLtemplater

  • January 10, 2013
  • 5 replies
  • 21 views

Forum|alt.badge.img
Hi

 

Im experiencing issues trying to use GML in XMLTemplater.

 

 

Code:

 

 {fme:get-xml-attribute("_conc")}

 

 

Works fine for 

 

_conc = <xml:Point> ....... </xml:Point>

 

Prints nothing for

 

_conc = <gml:Point> ...... </gml:Point>

 

 

Perhaps this not supposed to work? In that cas is there a workaround?

 

 

Best regards

5 replies

flavio
Forum|alt.badge.img
  • January 10, 2013
Hi

 

seems like a bug to me ... a bit of a hack would be to have a stringreplacer before and replace "gml:" with "gml-", do the stuff you need and at the very end another stringreplacer doing the opposite ...

Forum|alt.badge.img
  • Author
  • January 10, 2013

Hi Flavio, thanks!

Yes.. I guess thats the way I need to go.. to bad there is also some 'xml' in the GML that should actually be typed 'xml' and also the other way around. So I  must be careful when replacing.

Ill also be really happy If someone from Safe could answer regarding possible bug.

 

Cheers

Forum|alt.badge.img
  • Author
  • January 14, 2013
Bump :) Safe?

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • January 28, 2013
Hi all,

 

 

It turns out the namespace directive, at a minimum, is required if you are attempting to use the gml: construct in the XMLTemplater

 

 

_conc = <xml:Point xmlns:gml="http://www.opengis.net/gml/3.2"> ....... </xml:Point>

 

 

In addition, if you are extracting geometry from a feature to put into XML there is also a GeometryExtractor transformer which allows you to extract the geometry from the feature as a GML string.

lifalin2016
Contributor
Forum|alt.badge.img+29
  • Contributor
  • March 26, 2020

Hello from the future :-)

The comments here actually solved my problem in building a comprehensive  XML with XmlTemplater. I also needed the GeometryExtractor to generate GML geometry, to be used in a sub template.

And I ran into the same problem about XML namespaces.

The trick is to add the necessary namespaces to the outermost tag in the sub template expression, otherwise the XmlTemplater fails as it validates the output.

<ler:mytag gml:id="mytag.{fme:get-attribute("ID")}"
xmlns:ler="http://data.gov.dk/schemas/LER/1/gml" xmlns:gml="http://www.opengis.net/gml/3.2">...

Just wanted to add my experience on this problem, hoping it will help someone else 7 years from now :-)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings