|passing parameters [message #14457]
||Mon, 30 April 2007 20:30
Originally posted by: ymo.noemail.com|
Is it possible to pass parameters to a main.jet startup file ? For example
i would like my templates to generate multiple target files based on the
parameters that were passed to the main.jet file.
|Re: passing parameters [message #14518 is a reply to message #14457]
||Tue, 01 May 2007 13:02
| Paul Elder
Registered: July 2009
You have two choices for passing parameters to a JET transform.|
1) Put the information in the 'model' that is being loaded by the
transformation. In a previous post, it looked like you are loading a
document that conforms to a predefined schema, so this may not be an option.
Another alternative is to create a 'driver' model that the transform loads
as input, and have it reference the main document you want to process. You
driver document might look something like this:
<page path="input relative path to page to load" otherParm1="..."
In main.jet, you could then use the c:load tag to load the 'real' document:
<c:setVariable var="pageDriver" select="/page"/>
<!-- $org.eclipse.jet.resource.parent.fullPath is the workspace path of the
Use it to resolve and load $pageDriver/@path -->
<!-- pageDocument is the "DocumentRoot" (equivalent of /) in the loaded
document. So, if you normally write:
/root/view/ui, you'd write $pageDocument/root/view/ui -->
You can get more information on predefined variables like
And, more information on c:load at:
2) When using the JET2Platform.runTransformOnXXX() APIs, you can pass a Map
defining XPath variables. Each key is a variable name; each value is the
value. You can pass Strings, Booleans, subclasses of Number. Note that the
UI does not support this capability, so it will only work if you are
invoking the transform from this API.
"ymo" <firstname.lastname@example.org> wrote in message
> Is it possible to pass parameters to a main.jet startup file ? For example
> i would like my templates to generate multiple target files based on the
> parameters that were passed to the main.jet file.
Powered by FUDForum
. Page generated in 0.04350 seconds