tf:getDocname: Document vs. Element

Hi,

i want to retrieve the document name of nonxml files, which are indexed with the NonXML indexer. Here’s how my query looks like:


declare namespace tf="http://namespaces.softwareag.com/tamino/TaminoFunction"
for $f in input()/nixe[tf:containsText(properties/content, "Dauerbremse")]
let $n := tf:getDocname($f/..)
return $n

The same query fails, if I use tf:getDocname($f). The error message states, that $f has to be a “document”. (Most probably a DOM document, or something similar.)

Is this behaviour as expected?

Regards,

Jochen

Jochen,

yes, this is expected behaviour. The function requires a document node as input. Document node is one of the 7 node types defined in the XQuery data model. It is the root node of an XML document

Regards

Harald

Harald,

thanks for the reply. Sorry, if my question possible wasn’t very precise. Actually, I would like to ask the following:

  • Obviously I need this …/ in the case of documents created by the NonXML
    indexer. Do I need it in case of other documents as well?
  • If so: Shouldn’t the use of …/ be documented? Or, even better, couldn’t
    tf:getDocname be made that smart? Otherwise: Shouldn’t the exception
    for nixe documents be documented?

I really found this less than obvious.

Jochen

Jochen,

you need this for any document. The most general way to call
tf:getDocname is
tf:getDocname(xf:root($whatevernode))

We try to improve documentation for Tamino 4.4 in this respect

Regards

Harald