xs:gYear comparison in xquery

Hi!

I am using Tamino 4.1.4 and defined an attribute in my schema as xs:gYear.

How would I formulate my xquery in the where-clause to compare my gYear-attribute?

my example, which doesn’t work - I get a runtime type exception:
for $a in input()/SCHEMA
where ($a/@jahr=“2003”)
return $a

Thanks for the help,

Hi,

the types of the comparison operands must match, i.e. the literal must be casted:

for $a in input()/SCHEMA
where ($a/@jahr=xs:gYear(“2003”))
return $a

regards

Harald

Hi,

Unfortunately this doesn’t work:

<?xml version="1.0" encoding="windows-1252" ?>
- <xq:query xmlns:xq=“http://namespaces.softwareag.com/tamino/XQuery/result”>
- <![CDATA[
declare namespace xs="http://www.w3.org/2001/XMLSchema"
for $a in input()/ERKLAERUNG
where ($a/@jahr=xs:gYear("2003"))
return $a

]]>
</xq:query>
- <ino:message ino:returnvalue=“6358”>
<ino:messagetext ino:code=“INOXQE6358”>Function unknown</ino:messagetext>
ino:messagelineFunction: http://www.w3.org/2001/XMLSchema:gYear</ino:messageline>
</ino:message>
</ino:response>

Hi,

the gYear constructor function is available with the next version of

Sorry, sent to early …


Hi,

the gYear constructor function is available with the next version of
Tamino. For now use the string function to convert the gYear value to
a string and then compare, i.e. string($a/@jahr)=“2003”.

Regards,
Juliane.

Thanks