Closed VladimirAlexiev closed 7 months ago
I tried this
let $geom1 := $class/position
let $geom2 := $class/raeumlicherGeltungsbereich
let $geometry := xsparql2:_serialize($geom1 or $geom2)
but that's evaluated as false
because it checks the boolean value of those XML nodes, not their existence.
Then tried:
let $geom := $class/position union $class/raeumlicherGeltungsbereich
let $geometry := xsparql2:_serialize($geom)
net/sf/xsparql/rewriter/XQuerySerializer.g: node from line 29:29 required (...)+ loop did not match anything at input 'union'
Parse error: java.lang.Exception: Errors for Serializer. Translation aborted.
java.lang.Exception: Errors for Serializer. Translation aborted.
Then tried:
let $geom1 := $class/position
let $geom2 := $class/raeumlicherGeltungsbereich
let $geometry := xsparql2:_serialize($geom1 union $geom2)
net/sf/xsparql/rewriter/XQuerySerializer.g: node from line 31:44 mismatched tree node: union expecting <UP>
Parse error: java.lang.Exception: Errors for Serializer. Translation aborted.
I worked around it this way:
let $geom := ($class/X:raeumlicherGeltungsbereich, $class/X:position) # alternatives
let $geo := if (fn:empty($geom)) then () else fn:concat($id,"/geo")
let $geometry := if (fn:empty($geom)) then () else XSPARQL:_serialize($geom/*)
@nunolopez All of these alternatives
cause the following error:
Disjunction (given eg as
book/(chapter|appendix)/section
) is allowed in both XPath 2.0 and 3.1: