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
Expand all | Collapse all

Can [position() = 0] return multiple nodes?

  • 1.  Can [position() = 0] return multiple nodes?

    Posted Fri November 19, 2004 03:40 PM

    Hi,

    I must admit, that I am unsure, whether the
    following is a bug. Do the following:

    [LIST]

  • Insert the attached document into ino:etc.
  • Perform the following query:

       for $b in input()/open_auction[@id='open_auction2']
    return <a>{$b/bidder[position() = 0]}</a> 







    Note, that the query returns one element
    (a) with two child elements (bidder). IMO
    this ought not to be the case.

    Did I trigger a bug or do I misunderstand
    the concept?
    open_auction.xml (1.8 KB)


  • #Tamino
    #API-Management
    #webMethods


  • 2.  RE: Can [position() = 0] return multiple nodes?

    Posted Fri November 19, 2004 04:35 PM

    Hi,

    It seems that you have found a bug. Since the first position in the child sequence of an element node has the position 1, the correct result of your query is a single empty ?a? element.

    Best regards,

    Thorsten Fiebig


    #Tamino
    #webMethods
    #API-Management