Subject:Type error Author:rajat nair Date:29 Oct 2007 11:02 AM
Hi,
I get this error
[DataDirect][XQuery][err:XPTY0019]Error at line 11, column 8. It is a type error if the result of a step (other than the last step) in a path expression contains an atomic value.
The xquery expression is the following where i m calling a java function inside the xquery and this static java function is supposed to return a string(xml doc)upon which the query is executed
declare namespace a = "http://www.openapplications.org/oagis/9";
declare namespace file = "ddtekjava:com.blah.bb.Test";
declare function file:inp() as xs:string external;
<OrderResponse>
<OrderResponseHeader>
<OriginalOrderHeader>
<OrderHeader>
<OrderNumber>
<BuyerOrderNumber>
{file:inp
()/a:AcknowledgePurchaseOrder/a:DataArea/a:PurchaseOrder/a:PurchaseOrderHeader/a:DocumentID/a:ID/text()}
where inp() is the static java function being called.
Subject:Type error Author:Minollo I. Date:29 Oct 2007 11:16 AM
If your file:inp() function is returning a character string, rather than an XML fragment, you will need to parse it before applying XPath expressions to it; so, you would have to change your expression into something like:
...or you may want to change file:inp() to return an XML document rather than a character string (as a StAX stream - best for scalability, or a DOM tree ).
Subject:Type error Author:rajat nair Date:29 Oct 2007 04:07 PM Originally Posted: 29 Oct 2007 03:59 PM
hi,
Thank you for the prompt reply, i made the changes to the xquery the error has gone but when i tried to print out the result on to the console i just get the empty o/p file skeleton something like this withot any values returned by the query.
OrderResponseHeader>
<OriginalOrderHeader>
<OrderHeader>
<OrderNumber>
This was where the query was for getting the buyer order number
<BuyerOrderNumber/>
</OrderNumber>
<OrderIssueDate/>
<OrderReferences>
for some reason the query in between the tags does not return any results now,maybe its not able to apply the query to the dynamically incoming document at all !! when i store it at a absolute/relative location on my disk and then apply the queries it works fine.Hope you coud help me out on this one too.
Subject:Type error Author:Minollo I. Date:29 Oct 2007 04:20 PM
It's very difficult to answer your question without seeing the whole XQuery, the input documents involved and the result coming from the Java function you are using...
Any chance you can send us your whole testcase at stylus-field-report@progress.com?
Subject:Type error Author:rajat nair Date:29 Oct 2007 06:27 PM
I have send the required documents at the email address mentioned by you.I m in the process for evaluating the enterprise edition tool for multiple license purchase, hence a prompt reply like before would be great.