Hello, I’ve got the following problem.
We’re unloading data based on the value of an attribute, after the unload, we’d like to change the value of the attribute with the specific value.
Only I’ve just recently started developing for and working with Tamino. Some help would be appreciated.
Below an indication of what is shoud do/look like :
update for $a in input()/SITE/LINK
where $a/URL/@STATUS = “GOOD”
do $a/URL/@STATUS = “CHECK”
Ideally I’d like to update using a commandline instruction or something that can be scheduled through a batch process.
TIA
[This message was edited by Ni3L50L on 15 February 2005 at 13:38.]
The following Tamino 4.2 documentation should help:
XQuery 4 User Guide →
Performing Update Operations
You can write standalone programs to perform operations against Tamino using one of the APIs (Java/.NET).
Thanks for the info, but it seems I wasn’t specific enough.
I’ve read that part and concluded that an flwru query would suit mu needs best. I’ve also learned that It could be incorporated in an .vbs file, using a MSXML-object.
But, I’m not exactly sure how the syntax should be.
Someone gave me the following sample code and told me I could use this as an starting point. But I’m not sure how I could use this to get my xquery executed.
[sample code]
Set httpReq = CreateObject(“MSXML2.XMLHTTP”)
’ CHANGE ReqUrl if necessary
ReqUrl = “http://sduwebp01:8880/tamino/SDU/abonnement?_delete=abonnement[@ino:docname=‘Something.XML’]”
httpReq.open “Get”, ReqUrl,false
’ set headers
httpReq.setRequestHeader “Accept-Language”,“en”
httpReq.setRequestHeader “Accept-Charset”,“utf-8”
httpReq.send “”
’ Check http status
If httpReq.status >= 300 then
WScript.Echo “http error:” & httpReq.statusText
Wscript.Quit 1
End If
’ Http request OK. Has Tamino raised an error?
response = httpreq.responseText
If InStr(response, “ino:returnvalue=”“8300"”“) > 0 Then ’ record not found. Not really an error!
WScript.Echo “Document not found”
Wscript.Quit 2
ElseIf InStr(httpreq.responseText, “ino:returnvalue=”“0"””) > 0 Then ’ Document deleted = OK!
WScriptEcho = “Document deleted”
’ WScript.Echo “Document deleted”
Else ’ Something else - a real error
WScript.Echo “Tamino exception raised” & vbcrlf & response
Wscript.Quit 3
End If
[/sample code]
Actually in short : How can I execute a flwu query through MSXML ?
[This message was edited by Ni3L50L on 16 February 2005 at 8:40.]
The ActiveX API uses MSXML DOM objects.
An example in .vbs form:
' TaminoX ActiveX API
Dim TamX
' response documents from Tamino
Dim response
' create TaminoX instance
Set TamX = CreateObject("TaminoX.TaminoX1")
' initialize instance
TamX.Initialize()
' set database + collection URL
TamX.csDatabaseURL = "http://localhost/tamino/sxs440/ino:etc"
' perform XQuery
Set response = TamX.XQuery("input()/*")
WScript.Echo("XQuery response: "&response.xml)
' finish with instance
Set TamX = Nothing
Thank you very much, this is exactly what I was looking for. Kudos !!!