You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Santhosh <sa...@nsn.com> on 2012/07/24 08:55:15 UTC

Problme importing schema in an xquery endpoint

Hi,

I am trying to pass an element(x1:lookupCustomerRequest) as a header to an
xquery endpoint.
and got the below error:

  XQST0009: XQuery static error in #...ce/"; :) import schema default#:
    To import a schema, you need the schema-aware version of Saxon
Error on line 15 column 62
  XPST0051: XQuery static error in #...t as x1:lookupCustomerRequest)#:
    There is no imported schema for namespace
http://apache.org/customer_service
_http_soap/types
Error on line 19 column 41
  XPST0008: XQuery static error in #...pCustomerRequest/x1:customerId#:
    Variable $lookupCustomerRequest has not been declared




Used files:
**************************************************************************
Camel-context:xml
**************************************************************************
<camelContext ...>    
    <route>
        <from uri="cxf:bean:customer-ws?dataFormat=PAYLOAD"/>
        <choice>
            <description>&lt;from
uri="cxf:bean:customerServiceReal"/&gt;</description>
            <when>
                <simple>${in.header.operationName} ==
'lookupCustomer'</simple>
                <convertBodyTo type="org.w3c.dom.Node"/>                
                <setHeader headerName="customerId">
                    <xpath
resultType="org.apache.customer_service_http_soap.types.LookupCustomerRequest">/typ:lookupCustomerRequest</xpath>
                </setHeader>
                <to uri="log:lookupCustomerAfter?showAll=true"/>
                <to uri="xquery:lookupCustomer.xquery"/>
            </when>...
**************************************************************************
**************************************************************************
lookupCustomer.xquery:
**************************************************************************
import schema default element namespace "" at "customer.xsd";

declare namespace xs="http://www.w3.org/2001/XMLSchema";

declare namespace x1="http://apache.org/customer_service_http_soap/types";

declare namespace xf =
"http://tempuri.org/CustomerService/xquery/lookupCustomer/";


declare function xf:lookupCustomer($lookupCustomerRequest as
x1:lookupCustomerRequest)
    as element(x1:lookupCustomerResponse) {

<x1:lookupCustomerResponse
xmlns:x1="http://apache.org/customer_service_http_soap/types">
   <status>{ data($lookupCustomerRequest/x1:customerId/text()) } is
Away</status>
   <statusMessage>{ data($lookupCustomerRequest/x1:customerId/text()) } is
going to sleep</statusMessage>
</x1:lookupCustomerResponse>


};



declare variable $in.headers.lookupCustomerRequest as
x1:lookupCustomerRequest external;

xf:lookupCustomer($in.headers.lookupCustomerRequest)
**************************************************************************

First, i would like to know whether the above approach will help in passing
part of message body to xquery?
Then could you also please help me with either schema aware xquery
configuration or any other approach to pass part of body as runtime argument
to an xquery?


Br,
Santhosh




--
View this message in context: http://servicemix.396122.n5.nabble.com/Problme-importing-schema-in-an-xquery-endpoint-tp5713959.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.