IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.  return an Element of specific ID

    Posted Wed July 16, 2003 05:39 PM

    I have one XML Document. It has many Elements.
    Some of them have an attribute, which has the type of XS:ID, so it’s unique pro document.

    I would like the have the XQuery to get the
    Element, which has the attribute value ‘X’

    The value for ‘X’ is given.
    eN = ElementName is not given
    aN = AttributeName is not given


    queryString = “for $b in input()/labDevices//eN[aN='”+X+"'] ";

    queryString += “return $b”;

    What is the correct syntax to get the element,
    which has the attribute (ID) value for ‘X’ ?

    Thank you!
    Aykut


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: return an Element of specific ID

    Posted Wed July 16, 2003 06:54 PM

    Hello Aykut,

    would something like the following solve your query:

    for $x in input()/labDevices//@*
    where $x=‘X’
    return $x/…

    This looks for all attributes with a value of ‘X’ and returns the parent element of that value.

    Kind regards,

    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: return an Element of specific ID

    Posted Wed July 16, 2003 07:58 PM

    [within java code]
    queryString = "for $x in input()/labDevices//@* “;
    queryString += “where $x='”+typeID+”’ ";
    queryString += “return $x/…”;

    [while running]
    for $x in input()/labDevices//@* where $x=‘v1s19’ return $x/…

    I get a “Runtime type exception” Error. (TQuery Exception)


    #Tamino
    #API-Management
    #webMethods


  • 4.  RE: return an Element of specific ID

    Posted Wed July 16, 2003 09:48 PM

    Hello Aykut,

    I tried Stuart’s XQuery with an old “labDevices” document that I had from a previous test (which is stored in ino:etc), and it worked fine.

    Could you please post your schema and the document which is giving the error?

    (Perhaps we should also confirm which Tamino version you are using - 4.1.4.1 ?)

    Thanks,
    Trevor.


    #webMethods
    #API-Management
    #Tamino


  • 5.  RE: return an Element of specific ID

    Posted Thu July 17, 2003 09:36 PM

    Hey Trevor,

    thanks I already solved the problem with
    a little bit more coding.

    Aykut

    PS : I have the Tamino Version 4.1.4.1


    #API-Management
    #webMethods
    #Tamino