How can I get the doctype name in a query response??

Hello!!

this is my problem:

I have some doctypes with a set of common control tags.
When I execute a query I get the ino:id of the matching documents regardless the doctype.

Example:

Doctype DocA, ino:id=1

this is DocA


partner
ref123

Doctype DocB, ino:id=1

another doctype


partner
ref456

The Query:
*/controltags[ctrlA=“partner”]

to retrieve all the controltags sets that have a ctrlA child node whose value is “partner”.
I retrieve a respose like this:


- xql:result
-
partner
ref123

-
partner
ref456

</xql:result>

I get the ino:id but I also need to get the doctype name in this query response to identify the doctype that each result item
belongs to. Some ideal thing would appear like this:

- xql:result
-
partner
ref123

-
partner
ref456

</xql:result>

I know that I would be able to get it if I write my query as:
*[//ctrlA=“partner”],
retrieving all the document content, so the first tag show me the doctype name. BUT due to “technical causes” :frowning: I have to use
the first query sintax.

Any posibility to make me feel happy? :slight_smile:

Thank you very much!!

try this:
*[/controltags/ctrlA=“partner”]

christian campo

Thank you Christian
but unfortunately it doesn

Try…


*[/controltags/ctrlA=“partner”]/controltags

With the current version of Tamino (v2.3) it is possible to do what you require.

The only solution I can think of (and its a pain) is to manually include an additional attribute to when you store the documents and prehaps strip them off when the application processes them.

Maybe it wouldn’t be too difficult to include a ino:doctype attribute to each response document; I think it should be something configurable; maybe you could ask your local Software AG for a change enhancement?