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

delete an instance with xquery

  • 1.  delete an instance with xquery

    Posted Thu August 17, 2006 04:10 PM

    hello there,
    i expect to delete an entire document with xquery, but it doesn’t work.
    e.g.

    update for $q in input()/organisation
    where $q/id=1
    do(
    delete $q
    ) 

    I got the error message:
    update results in non-well-formed document;attempt to delete the root element

    Any suggestion is welcome,

    Thank you in advance

    chacha


    #API-Management
    #webMethods
    #Tamino


  • 2.  RE: delete an instance with xquery

    Posted Thu August 17, 2006 05:31 PM

    Hi chacha,

    the $q that you want to delete is the root element, i.e. the uppermost element in the document right below the document node. Deleting this would leave the
    document empty and thus non-well-formed.

    Delete the document node instead, i.e. do delete $q/…

    Regards,
    Juliane.


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: delete an instance with xquery

    Posted Thu August 17, 2006 06:23 PM

    Thank u very much :smiley:

    Best Regards,

    Chacha


    #API-Management
    #Tamino
    #webMethods


  • 4.  RE: delete an instance with xquery

    Posted Fri August 18, 2006 05:18 PM

    You can also use the root() function to get the document node.


    #API-Management
    #Tamino
    #webMethods