Skip to main content

My configuration in the JSONTemplater looks like this:

 

{

  "type": "Feature",

  "geometry": {

    "type": "Point",

    "coordinates": n

      fme:get-attribute("X"),

      fme:get-attribute("Y")

    ]

  },

  "properties": {

  "33064" : fme:get-attribute("33064"),

  "33085" : fme:get-attribute("33085"),

  "33103" : fme:get-attribute("33103")

  }

}

 

As result I get:

 

{ "type" : "Feature", "geometry" : { "type" : "Point", "coordinates" : u 7.61438690276304, 47.5603635244644 ] }, "properties" : { "33064" : "", "33085" : 94328460, "33103" : "2. von B Spezmast Nr.55" } }

 

The number is not set in double quotes which results in error when I use the json string. Any ideas what could be the reason.

Hi @tschoppenhof​ ,

You can cast a numeric value to a string value with the "xs:string" function.

Try this.

"33085" : xs:string(fme:get-attribute("33085")),

 


Thanks takahshi, this works fine.


Hi @tschoppenhof​ ,

You can cast a numeric value to a string value with the "xs:string" function.

Try this.

"33085" : xs:string(fme:get-attribute("33085")),

 

This was helpful to guide me to all different XQuery functions, needed the xs:double.

For several other functions look at the w3 documentation

XPath and XQuery Functions and Operators 3.0 (w3.org)


Reply