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
Julio de la VegaSubject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Julio de la Vega
Date: 20 Dec 2007 07:18 AM
Originally Posted: 20 Dec 2007 07:17 AM
Hi *,

I have developed an XQuery code that I would like to run in server side under DataDirectXQuery converter. I think that I have to set up my scenario properties according to DataDirectXQuery.

After setting up my scenario with processor type to DataDirectxQuery and running again my code, I got this error message:

[DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:[DataDirect][XQuery]Error during conversion: Unable to open: \Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.txt


This message does not appear when I run my code with built-in processor.

How do we have to set up our scenario to run this code under JAVA with DataDirectxQuery?

Code:

let $doc := doc('converter:file:///\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.conv?file:///\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.txt')
let $traducemes := doc(".\mes.xml")
return
<root>
{
for $REG_10 at $REG_10-startPos in $doc/root/REG_10
return



Thanks in advance

Regards

Postnext
Minollo I.Subject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Minollo I.
Date: 20 Dec 2007 08:40 AM
Change:
let $doc := doc('converter:file:///\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.conv?file:///\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.txt')

into

let $doc := doc('converter:file://\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.conv?file://\\Server-hps\tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\SICAVXQUERY.txt')

Postnext
Julio de la VegaSubject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Julio de la Vega
Date: 20 Dec 2007 09:04 AM
Hi Minollo,

First error message has disappeared but now, $traducemes gives a new error:

[DataDirect][XQuery][err:FODC0005]Exception returned by Adaptor (Streaming Adaptor) : java.io.FileNotFoundException: \Server-hps\Tecnico\Proyectos\Stylus\Desarrollos\SICAV\XQUERY\mes.xml (El sistema no puede hallar la ruta especificada)

(El sistema no puede hallar la ruta especificada) means that system can no find the path

My original code for $traducemes is:

let $traducemes := doc(".\mes.xml")

Thanks again

Postnext
Minollo I.Subject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Minollo I.
Date: 20 Dec 2007 09:14 AM
I guess your XQuery is in that same UNC location. That apparently is breaking the ability to resolve the relative path. We will look into it, but just be aware that DataDirect XQuery and XML Converters (the version used by XQuery, at least) are Java components; so, dealing with UNC paths may create troubles.

In the meanwhile, I can only suggest that you either reference mes.xml through an absolute path, or you don't use UNC paths.

Postnext
Julio de la VegaSubject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Julio de la Vega
Date: 20 Dec 2007 10:01 AM
If I am using for my queries as input xml the result of the conversion from a custom conv file and a flat file. Which is the best option to call this information in my xQuery code if I will use my XQuery in a JAVA and DataDirectXQuery enviroment?

Custom CONV file and Flat file will generate big xml files (more than 1GB) Can I have any problem with memory?

Postnext
Minollo I.Subject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Minollo I.
Date: 20 Dec 2007 10:13 AM
You are saying you need to do what your XQuery is already doing, right? Using the result of a custom conversion as input.

You can do that using the doc() function, as in your current code; or you can do that using an external variable and binding the result on the conversion dynamically to the variable through Java (the Java code generation utility in Stylus can help you with that, or we can send you a specific example if you need it).

If you are talking about using the result of an XQuery execution as input for another XQuery execution, that is possible too, in a scalable way.

All methods these are able to leverage the streaming and projection optimizations in DataDirect XQuery. Clearly, how scalable and fast the XQuery execution is against a large data sets also depends on what the XQuery itself is doing; but in general you have the most scalable and performant XML manipulation tool available on the market in your hands when you use DataDirect XQuery.

Postnext
Julio de la VegaSubject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Julio de la Vega
Date: 20 Dec 2007 10:33 AM
Could you please send me the java code example?

Thanks again

Postnext
Minollo I.Subject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Minollo I.
Date: 20 Dec 2007 02:58 PM
This is what the XML Pipeline code generator created for me:

ConverterFactory cFactory = new ConverterFactory();

Reader xqueryReader = null;
XQConnection xqconnection = null;
DDXQDataSource ddxqDataSource = new DDXQDataSource();

// Declarations for node SICAVXQUERY
final String SICAVXQUERY_uri = "file:///c:/SICAVXQUERY.xquery";
XQPreparedExpression xqExpr = null;
final String converterSpec = "converter:file:///c:/SICAVXQUERY.conv";
String converterFile = "file:///c:/SICAVXQUERYReducido.txt";
OutputStream output_strm = null;
try {
xqconnection = ddxqDataSource.getConnection();
XQItemType type = xqconnection.createElementType(null, XQItemType.XQBASETYPE_UNTYPED);
XQItemType documentType = xqconnection.createDocumentElementType(type);
XQStaticContext context = xqconnection.getStaticContext();
context.setContextItemStaticType(documentType);
context.setBindingMode(XQConstants.BINDING_MODE_DEFERRED);
xqconnection.setStaticContext(context);

XMLStreamReader converterResult = cFactory.newConvertToXML(converterSpec).getXMLStreamReader(new StreamSource(converterFile));

System.out.println("Running node SICAVXQUERY_xquery");
xqueryReader = new FileReader(new File(new URI(SICAVXQUERY_uri)));
xqExpr = xqconnection.prepareExpression(xqueryReader);
xqExpr.bindDocument(new QName("doc"), converterResult);
output_strm = new FileOutputStream("c:/someoutput.xml");
xqExpr.executeQuery().writeSequence(output_strm, null);
output_strm.close();
} finally {
if (xqueryReader != null) xqueryReader.close();
if (xqconnection != null) xqconnection.close();
if (xqExpr != null) xqExpr.close();
if (output_strm != null) output_strm.close();
}
}

Posttop
Julio de la VegaSubject: [DataDirect][XQuery][err:FODC0005]Exception thrown by URIResolver:
Author: Julio de la Vega
Date: 21 Dec 2007 03:33 AM
Hi Minollo,

Thank you

Regards

 
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.