Query part of a huge xml document and updating it

Hi

It seems that my previous question got lost when I had to sign on again.

My question was this in short:

I want to create a query that will only bring back only selected nodes.

I want then to make changes to those spesific nodes and update the xml document with those changes.

I am using Apache with tamino on the moment.

Part of my xml document look like this :


0
String
String


String
String



String
String
String
String
String

.
.
.


When I do the following query :

http://ac5272/tamino/Commsure/Commsure/Policy?_XQL=/Policy[PolicyNumber=0 and Insurer=“String”]//Insurer|//PolicyNumber

I want only to retrieve the document with Policy Number 0 and het the nodes Policy number and Insurer. I get the following document :

<?xml version="1.0" encoding="iso-8859-1" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
xql:query/Policy[PolicyNumber=0 and Insurer=“String”]//Insurer|//PolicyNumber</xql:query>
- <ino:message ino:returnvalue=“0”>
ino:messagelineXQL Request processing</ino:messageline>
</ino:message>
- xql:result
Pol1
Pol2
String
0
2855879
5555899
3455749
</xql:result>
- <ino:message ino:returnvalue=“0”>
ino:messagelineXQL Request processed</ino:messageline>
</ino:message>
</ino:response>

Where as I use this query :

http://ac5272/tamino/Commsure/Commsure/Policy?_XQL=/Policy[PolicyNumber=0 and Insurer=“String”]

I get the spesific document but with all the nodes :

<?xml version="1.0" encoding="iso-8859-1" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
xql:query/Policy[PolicyNumber=0 and Insurer=“String”]</xql:query>
- <ino:message ino:returnvalue=“0”>
ino:messagelineXQL Request processing</ino:messageline>
</ino:message>
- xql:result
-
0
Zero
String
-
-
String
String


-
String
String
String
String
String

.
.
.


Thanks
Miklos

Miklos Hagymassy

It is not possible with X-Query/Xpath expressions to selectively retrieve nodes in the manner you describe - this is a “feature” if you like of XPath. So in your case if you want the and nodes which are both immediate children of then you would have to ask for the node, i.e.

http://ac5272/tamino/Commsure/Commsure/Policy?_XQL=/Policy[PolicyNumber=0 and Insurer=“String”]

If you want to bring back specific nodes and update them without updating the whole document then you would need to use NodeLevelUpdate feature (assuming you are using Tamino v3.x). For this you need to be using IIS since NodeLevelUpdate is implemented as a IIS Filter.

Tamino v4.1 has recently been released and this has an XQuery feature and XQuery-Update feature. With XQuery-Update you can modify portions of a document without retrieving the whole document; the node level updates are done with the Tamino server.

Hope this helps.


Stuart Fyffe-Collins
Software AG (UK) Ltd.