Too many ways to build a query!

The API provides these methods to build an XQuery request:
- TaminoXmlDocument.BuildQuery(“query”)
- TaminoXmlDocumentProperties.BuildQuery(“query”)
- new TaminoQuery(“query”)

If I use the last one, there is no access to any Tamino attributes and it is generally suitable for use with queries that return constructed, non-Tamino documents.

If I use the TaminoXmlDocument builder, then I can’t get the additional Tamino attributes that are provided by TaminoXmlDocumentProperties. And, if I use the TaminoXmlDocumentProperties builder, I can’t get the Tamino document without re-calling Tamino!

This seems overly complicated to me…
1) couldn’t these two TaminoXmlDocument* builders be combined into one?
2) could the documentation be updated to clarify and cross-reference the different query builders…assuming there is a good reason for the different ones.

Douglas Kelly,
Principal Consultant
Software AG, Inc
Sacramento, California

The “normal” way to build a query is to construct a TaminoQuery by hand. It is possible to emulate the serialization classes using TaminoQuery as that is all they do.

The BuildQuery methods use the following Tamino functions:


in fact if you do a ToString on the returned TaminoQuery it will show you the query that will be issued.

However, it would not be difficult to alter TaminoXmlDocument to return the same properties as TaminoXmlDocumentProperties.

Couldn’t they all be made to return the same root document so each query doesn’t blow up complaining about the “unexpected” stuff?

If I try to cast the query result from a TaminoXmlDocumentProperties.BuildQuery to a TaminoXmlDocument, I get:

Unhandled Exception: System.InvalidOperationException: There is an error in the XML document. —> System.InvalidOperationException: was not expected.

A similar error occurs if you try to cast the result of a “new TaminoQuery()” build or TaminoXmlDocument.BuildQuery() to the “wrong” type…generally irritating and not intuitive.

Douglas Kelly,
Principal Consultant
Software AG, Inc
Sacramento, California

I’m not sure I understand what you mean about “blow up due to unexpected stuff”?

As they are serializers they have associated schema which is why you probably can’t cast them.

I think that the original intention of the serializers was to provide a convenience mechanism for doing what one can do by hand using TaminoQuery.

Also “properties of a document” is a significantly different concept to “document” which is why only TaminoXmlDocument returns the actual document.