XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
rajat nairSubject: 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.

Regards
Rajat

Postnext
Minollo I.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:

ddtek:parse(file:inp())/a:AcknowledgePurchaseOrder/a:DataArea/a:PurchaseOrder/a:PurchaseOrderHeader/a:DocumentID/a:ID/text()

...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 ).

Postnext
rajat nairSubject: 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.

Regards
Rajat

Postnext
Minollo I.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?

Posttop
rajat nairSubject: 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.

Regards
Rajat

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.