Oh, sorry, yes. The QName needs to be converted to an XQItem, which you can do using
dataFactory.createItemFromObject(new QName("some-element-name"))
Michael Kay

From: Erik Rens [mailto:mail2rens@gmail.com]
Sent: 02 April 2009 12:26
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Fwd: Xpath 2.0 sequences and Saxon examples problems.

Yes thats what I mean, thanks. But the solution didn't work for me.......

BindItem needs a XQItem not a QName as second parameter. So what do you mean with that ?

I changed the variabele in my xquery string to: "declare variable $element xs:XQItem() external;" (i also tried xs:QName).

Use the following binding:

XQItem qi = conn.createItemFromString("Number", null);
xqExpr.bindItem(new QName("element"), qi );

xquery adapt to :

"where $r1/*[node-name() = $element] = $r2/ID".

but error appear:
Error on line 1 column 129
  XPST0003: XQuery syntax error in #...atchingElement1 as xs:xqitem()#:
    Expected type name in SequenceType, found <function>(
Error on line 1 column 235