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
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Clarice OgburnSubject: Passing Parameters and Multiple Inputs in Stylesheet
Author: Clarice Ogburn
Date: 10 Mar 2016 09:31 PM
We are working on a project that would require multiple inputs to transform into a single output.

In the current stylesheet, there are two input documents. Both XML. However, when the stub code is generated in Stylus Studio, we noticed that there was only 1 "inputURI" instead of "2". We also noticed that the reference to the second input document was saved as a part of the Stylesheet under <"MapperInfo">

Is there a way to pass parameters for the input documents that will be transformed by the stylesheet.

Another Scenario that was discussed was passing in XML Document and JSON Document as input to a stylesheet.

Lastly, we noticed that the inputURI's are normally strings, but could you use the Java "String Object" instead.

Ultimately, We want to be able to send multiple documents using java code to the transformer using either String or Objects which might point to JSON or XML documents.


DocumentTest_277_to.xsl
Current Stylesheet

UnknownClm.xml
Input File

Unknown837_Head_Schema.xml
Input File

Postnext
Ivan PedruzziSubject: Passing Parameters and Multiple Inputs in Stylesheet
Author: Ivan Pedruzzi
Date: 11 Mar 2016 08:11 AM
The XSLT mapping tool by default binds additional inputs to document function calls.

To change the binding right click on the document node in the source panel the click on Associate With -> Global Variable

After doing so Stylus Studio will initialize the
parameter tab in the scenario dialog with an XPath expression like document(<uri to xml>)

The Java code generator does not support binding parameter with XPath expression, you will need to code it manually.


Ivan Pedruzzi
Stylus Studio Team

Postnext
Clarice OgburnSubject: Passing Parameters and Multiple Inputs in Stylesheet
Author: Clarice Ogburn
Date: 14 Mar 2016 08:57 PM
I followed the instructions given. However,when I try and compile the stylesheet, I get the following error.

Recoverable error: file:///c:/Users/cogburn/DOCUME~1/DATA_D~1/DATA_D~1/TEST_2~2.XSL: line 3: An attribute whose value must be a QName or whitespace-separated list of QNames had the value '837 Head Input'
Recoverable error: file:///c:/Users/cogburn/DOCUME~1/DATA_D~1/DATA_D~1/TEST_2~2.XSL: line 4: An attribute whose value must be a QName or whitespace-separated list of QNames had the value '837 Head Schema'


After I righch Click and select Global variable, it asks for a name which, I entered the names "837 Head Schema" and "837 Head Input".

I'm also attaching a screenshot of my parameters view.

Thanks,

Clarice Ogburn


DocumentparametersView.docx
Screen Shot

Posttop
Clarice OgburnSubject: Passing Parameters and Multiple Inputs in Stylesheet
Author: Clarice Ogburn
Date: 14 Mar 2016 09:46 PM
NM I was able to resolve the error.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.