xquery and x-query

Dear all,

I have little confusion in my mind. so please help to get rid out of the problems.

i have one collection for storing employee details.

when i try with the following url
http://localhost/tamino/welcome_4_4_0/colemployees?_XQL=//employee
i am able to view all the employees

http://localhost/tamino/welcome_4_4_0/colemployees/employees/@1
is not displaying enything. a blank page only

why the second one is not working

please help

regards

Is your document type “employee” or “employees”? The second example has “employees”, the first has “employee”.

thanks for replying

my doc type is employees

employee is a tag inside that that contains subnodes name and title.

regards sreeju

Perhaps an obvious question, but does the document with ino:id=1 still exist? Because the first query is asking for all the employee nodes, but the second one points to a specific document which may have been deleted.

Can you please make it clear. what was my belief that @1 will return the first existing documet from doctype. is it wrong

regards sreeju

When Tamino stores a document it assigns it a unique value for the ino:id attribute. If you delete the document, Tamino no longer has a document with that ino:id. (There’s a flag in the schema that lets you tell Tamino to reuse ino:id values, but I think it’s off by default.) “http://localhost/tamino/welcome_4_4_0/colemployees/employees/@1” is really just an abbreviation for “http://localhost/tamino/welcome_4_4_0/colemployees?_XQL=/employees[@ino:id=1]
so if you’ve deleted the first document you created it will not return anything.

when you use your first query, one of the attributes returned with each document is the ino:id. You can try the second query with any of the ino:id values that are returned there.