appendChild()

Hi all,

My dtd is as follows:






<!ATTLIST SuccessfullMethod Class CDATA #REQUIRED
Method CDATA #IMPLIED>

Now i want to add a ‘successfullMethod’ Element with the following code:

TaminoClient tamino=new TaminoClient(“http://localhost/tamino/admire/DatacommCollection”);
tamino.startSession();
TaminoResult tr = tamino.appendChild( ??relUrl?? , “//Status[//Control/@MessageId=‘555555’]”, node);
tamino.commit(false);
tamino.endSession();


http://localhost/tamino/admire/DatacommCollection/Datacomms?_xql=//Status[//Control/@MessageId=‘555555’]
gives the right result, so i suppose the query is ok.
I’m unsure about what to fill in for ‘relUrl’, i tried a lot of things and in no way an exception in thrown.


regards,

The parameters to appendChild are:

1) relUrl - relative URL to the document
This must be a direct URL to the single document you want to update. It can’t be a query. The NodelLevelUpdate.dll executable does a get on this document. The relurl you specify here is appended to the TaminoClient URL to make a complete reference to a single document. So, an example might be:

TaminoClient is based on "http://localhost/tamino/admire"
relurl is "/DatacommCollection/Datacomms/@1"

2) xpath - query path to the node
This is the path to the node in the document which will be the parent of the new node. In your case, this might be

"Datacomms/Datacomm/Status"

3) node - new node to append
This will be an instance of a SuccessfullMethod element in your case.

Also, appendChild() only works if NodeLevelUpdate is installed, and this is only possible with IIS.

Hope this helps.