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.


#TechXchangePresenter
 View Only
  • 1.  Update using prefixes

    Posted Wed February 04, 2004 09:55 AM

    Hello!

    I have been trying to modify data using “TAMINO PHP API”. I defined two prefixes: “w” and “o”. Unfortunately, when I tried to execute method “xquery”, I got the following error:

    Tamino Error 6354: Namespace prefix undefined (Namespace prefix: w)

    ----------------------------------------
    $xql = "update replace input()/w:doc[o:data/o:Id="$id"] with ".
    “<w:doc xmlns:o=prefix1 xmlns:w=prefix2”> ".
    “<o:data>”.
    “<o:Id>$id</o:Id>”.
    “<o:surname>$surname</o:surname>”.
    “<o:name>$name</o:name>”.
    “</o:data>”.
    “</w:doc>”;

    if (!($tamino->xquery($xql)))
    thfPrintError($tamino);
    else
    {
    echo “OK”;
    }
    ----------------------------------------

    How can I fix it?

    In advance, thanks a lot!


    regards,
    Dariusz


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 2.  RE: Update using prefixes

    Posted Wed February 25, 2004 12:05 PM

    Hello Dariusz,

    this is actually not a problem of the PHP API
    but rather a problem of an incorrect XQuery
    update statement. You use the w and o prefixes
    in the replace statement before you defined
    them. Place the following two lines at the
    beginning of your XQuery statement, and then
    it should work:

    declare namespace w="prefix2" 
    declare namespace o="prefix1" 



    regards,
    Heiko


    #webMethods
    #API-Management
    #webMethods-Tamino-XML-Server-APIs