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
Dominic VieiraSubject: Deploying an xquery file with more than one XML source document
Author: Dominic Vieira
Date: 04 Jun 2007 11:59 AM
When generating XQuery file from Stylus Studio, Stylus Studio IDE allows the
xquery select/associate from/to multiple XML sources.

The problem is when the java code generated from xquery file, it only
selecting from the first xml file that the xquery file referenced. The
problem seen happening to both Saxon processor and DataDirect processor.

Following are some of the generated java code:


Configuration m_cfg;
StaticQueryContext m_sqc;
DynamicQueryContext m_dqc;

BasicResult m_transformResult;

. . . . .

m_sqc = new StaticQueryContext(m_cfg);
if (m_baseURI != null)
m_sqc.setBaseURI(m_baseURI);
m_dqc = new DynamicQueryContext(m_cfg);

parseParametersSaxon(m_cfg, m_paramNames, m_paramValues, m_baseURI, m_dqc);

m_queryReader = new InputStreamReader(m_scriptSource.getInputStream());

if (m_xmlSource!=null && m_xmlSource.getInputStream() != null)
m_dqc.setContextItem(m_sqc.buildDocument(m_xmlSource));


. . . . .

exp.run(m_dqc, m_transformResult, props);

Posttop
Minollo I.Subject: Deploying an xquery file with more than one XML source document
Author: Minollo I.
Date: 04 Jun 2007 12:45 PM
What Stylus Studio version are you using? (Help > About) If it's not v2007 Release 2, I would suggest that you upgrade to it (www.stylusstudio.com/download), as code generation has been improved there, and the DataDirect XQuery version included in Release 2 also supports the default input context.

How does your XQuery reference multiple inputs? If it references them through the default input context and through doc() functions, then you'll see only one of them in the generated code, as only one is dynamically bound to the default input context. If you want to be able to control all the inputs through the Java code, you should change the inputs to be defined as external variables rather than using the doc() function directly (if you are using Mapper, just right click on a source, and select "Associate with... > Global variable").

If the problems persist, can you please attach the XQuery you are using? (or email it to stylus-field-report@progress.com)

Thanks.

 
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.