Any ideas?

Anfang der weitergeleiteten E-Mail:

Von: Truong An Nguyen <ngtruongan@gmail.com>
Betreff: Re: [basex-talk] Error by retrieving an attribute of the element returned by the root function
Datum: 21. November 2011 14:38:51 MEZ
An: Lukas Lewandowski <lukas.lewandowski@uni-konstanz.de>

Thanks very much for your response.

How can I use "instance of" with Basex? I can not do: $a instance of Action. Action an abstract ComplexType.

Thanks

An



On Mon, Nov 21, 2011 at 10:34 AM, Lukas Lewandowski <lukas.lewandowski@uni-konstanz.de> wrote:
Hi An,

the root function returns the root of the tree to which the current node belongs, usually be a document node. You can retrieve the attribute according to your root element e.g. by $otx/ROOT_ELEMENT/@package, where ROOT_ELEMENT ist the root element of your document.

Lukas


2011/11/21 Truong An Nguyen <ngtruongan@gmail.com>
Hi,

In my xquery, I use the root() function to return the root element of an element. I could get the root element,  but I couldn't get any attributes of it.

For example: 
for $value in collection()/otx/imports/import
let $otx:=root($value)                         
return $otx/@package

Thanks

Cheers,
An

_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk