webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  xs:gYear comparison in xquery

    Posted Mon March 22, 2004 08:23 AM

    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,


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: xs:gYear comparison in xquery

    Posted Mon March 22, 2004 11:28 AM

    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


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: xs:gYear comparison in xquery

    Posted Mon March 22, 2004 11:49 AM

    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>


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: xs:gYear comparison in xquery

    Posted Mon March 22, 2004 01:46 PM

    Hi,

    the gYear constructor function is available with the next version of


    #webMethods
    #API-Management
    #Tamino


  • 5.  RE: xs:gYear comparison in xquery

    Posted Mon March 22, 2004 01:49 PM

    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.


    #API-Management
    #Tamino
    #webMethods


  • 6.  RE: xs:gYear comparison in xquery

    Posted Mon March 22, 2004 02:04 PM