[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    OT: Question about integrating with BEA's XQuery engine
From:       Dmitri.Colebatch () toyota ! com ! au
Date:       2004-04-20 1:17:09
Message-ID: OFFD9EF581.B3C30363-ONCA256E7C.0006C852 () toyota ! com ! au
[Download RAW message or body]





hey all,

Firstly, anyone who is on the user list can ignore this, I've already asked
this question there and didn't receive any responses.  I'm hoping someone
here might be able to help me out.  I'll cut and paste my email to the user
list
(http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xmlbeans-user@xml.apache.org&msgNo=427):

hey all,

Firstly, this is a little off topic, so if you're not interested in the
subject, stop reading (o:

I've just received a task that is absolutely crying out for the ability to
use external functions and whilst I've "needed" this in the past, I've been
able to work around it without too much trouble.

My question to the list is - has anyone tried/had success binding external
functions using XQuery and xqrl.jar from WL 8.1 (SP2)?  Or does anyone have
any advise for the best starting point to do this.

I've looked at various possible points to hook into the code, as I
understand it BEA's XQuery implementation does allow binding external
functions, the only problem is that its not exposed via XMLBeans.  At the
moment I'm looking at com.bea.xquery.operators.Operator which I assume I'll
need to implement and have also looked at com.bea.xquery.xdbc.Connection
and com.bea.xquery.xdbc.Context which has a method called addOperator on
it.  So what I'm trying atm is this:

            XmlObject xml =
XmlObject.Factory.parse("<top><second><third>text</third></second></top>");

            Connection connection = DriverManager.getConnection();
            Operator operator = new Operator(BEA_QNameToken.create(new
MyBEA_Token((short) 0, "foobar"), new MyBEA_Token((short) 0,
"http://toyota.com.au/xquery")),
                                             new Signature(new ArrayList(),
XQueryType.ANYTYPE))
            {

            };
            connection.getContext().addOperator(operator);

            xml.execQuery("declare namespace
toyota=\"http://toyota.com.au/xquery\"" + Str.LINE_SEPARATOR +
"<foo>{toyota:foobar()}</foo>");

this throws a runtime exception caused by a class cast exception so I'm not
having much luck atm.

I'd be greatful for any input here...

cheers
dim


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic