I use several XMLXQueryExtractors in my workspace, each with queries similar to the example below. Sometimes a query returns no results, which causes the transformer to generate a warning. This leads to a lot of unnecessary log entries and clutters the log.
I’ve tried checking whether the query returns a result before processing it, but the check still sometimes evaluates to “no result.”
Does anyone know how to prevent these warnings? Could it be related to the fact that return only uses fme:set-attribute and therefore doesn’t actually return a value?
Query:
declare namespace gml = "http://www.opengis.net/gml/3.2";
declare namespace aixm= "http://www.aixm.aero/schema/5.1";
let $id := fme:get-attribute("arc_id")
for $arc in (
//gml:Curve[@gml:id = $id]/gml:segments/gml:ArcByCenterPoint,
//aixm:Curve[@gml:id = $id]/gml:segments/gml:ArcByCenterPoint
)
return (
fme:set-attribute("startAngle", if ($arc) then string($arc/gml:startAngle) else ""),
fme:set-attribute("endAngle", if ($arc) then string($arc/gml:endAngle) else "")
)

Warnings in the log:
3111 2025-12-1 14:16:57 | XMLXQueryExtractor_6 (XQueryFactory): Query `declare namespace gml = "http://www.opengis.net/gml/3.2";
3112 2025-12-1 14:16:57 | declare namespace aixm= "http://www.aixm.aero/schema/5.1";
3113 2025-12-1 14:16:57 |
3114 2025-12-1 14:16:57 | let $id := fme:get-attribute("arc_id")
3115 2025-12-1 14:16:57 |
3116 2025-12-1 14:16:57 | for $arc in (
3117 2025-12-1 14:16:57 | //gml:Curve[@gml:id = $id]/gml:segments/gml:ArcByCenterPoint,
3118 2025-12-1 14:16:57 | //aixm:Curve[@gml:id = $id]/gml:segments/gml:ArcByCenterPoint
3119 2025-12-1 14:16:57 | )
3120 2025-12-1 14:16:57 |
3121 2025-12-1 14:16:57 | return (
3122 2025-12-1 14:16:57 | fme:set-attribute("startAngle", if ($arc) then string($arc/gml:startAngle) else ""),
3123 2025-12-1 14:16:57 | fme:set-attribute("endAngle", if ($arc) then string($arc/gml:endAngle) else "")
3124 2025-12-1 14:16:57 | )
3125 2025-12-1 14:16:57 | ' returned no results
3126 2025-12-1 14:16:57 | XMLXQueryExtractor_9 (XQueryFactory): Results String has zero length, no results were returned


