Version 9.6
 —  The CentraSite API for XQJ  —

CentraSite-Specific Extensions to XQJ

Software AG's CentraSite adds useful facilities to the XQJ interface for updating a database and for inserting a document into the CentraSite registry/repository. These facilities are described in the following sections.


Updating a Database Using XQJ

Using the CentraSite XQJ interface, you can update the registry/repository. This feature is a Software AG specific extension of XQJ.

Start of instruction setTo update an XQuery

  1. Specify the string or the reader object containing the update XQuery

  2. Invoke the executeUpdate() method on the expression

Example

String updateQuery = "update for $q in input()/bib/book where $q/@year = 1994" +
"do replace $q/title with <title>XQJ from SoftwareAG </title>";
XQResultSequence xqResultSequence = ((XQExpressionImpl)expression).executeUpdate(updateQuery);
// execute update

Top of page

Inserting a Document in the CentraSite Registry/Repository

This feature is a Software AG specific extension of XQJ.

Start of instruction setTo insert a document in the CentraSite Registry/Repository

  1. Specify the XML instance to be inserted as a string or the reader object.

  2. Execute the executeInsert() method in XQExpression to insert a document.

Example

String insertStr = "<your xml goes here>";
(XQExpressionImpl)expression).executeInsert(insertStr);

Top of page