can xsl parameters be int or boolean

V

vaibhav

Hi
I am writing a wrapper over the existing xalan libraries. I have to
pass xsl parameters to the xslt processor at run time. These paramters
are later referenced in the stylesheet .The xalan cpp api which passes
the xsl parameters to the xslt processor is setStylesheetParam(), which
allows only to pass string type of parameters.

Now my question :
1)Can an xslt have of parameter apart from string type or is it
necessary that the xsl parameters will always be of string type.
2)When xalan cpp based transformer compiles the xsl stylesheet, what is
the format of the compiled stylesheet. I mean can i store it once after
compilation and use the same compiled object code for transformation.
3)Is there any major diff between XSLT versions 1.0 and 2.0. I was
going through the documentation but could not find much. Also does the
latest xalan processor processes XSL stylsheet version suppiled to it
at run time, so that the results are not consistent

I have been trying to look for the answers everywhere on the net, but
no success.
plz help

Vaibhav
 
M

Martin Honnen

vaibhav wrote:

1)Can an xslt have of parameter apart from string type or is it
necessary that the xsl parameters will always be of string type.

I don't use Xalan C++ but in general params to a stylesheet can have at
least the basic XPath types number, string, boolean and the type
node-set. Of course the processor needs to provide an API then to pass
in params of different types, for instance the JAXP API has
<http://java.sun.com/j2se/1.5.0/docs...Parameter(java.lang.String, java.lang.Object)>
which allows to pass in an object of any Java type.

3)Is there any major diff between XSLT versions 1.0 and 2.0. I was
going through the documentation but could not find much.

Yes, in my view there are major differences, not alone indicated by
using a new major version number (i.e. 2.0) instead of e.g. 1.1.
I am not going to try to write down what all the differences are but one
example is, as XSLT 1.0 uses XPath 1.0, XSLT 2.0 uses XPath 2.0. And if
you compare the number and range of functions XPath 2.0 provides to that
of XPath 1.0 then you see a major difference for instance.
 
J

Joe Kesselman

V

vaibhav

thanks for the speedy reponse.
Regarding the passing of params to the XSLT processor, I have found out
that though setstylesheetparam() passes param value as a string, but
for passing the string value we have to enclose the value withing
single quotes. i think an example will make it clear.
For setting a string parameter say name, the call will be
setStylesheetParam(" ' vaibhav' ", " name ") ie we have to enclose the
expression within single quotes. For setting integeral parameter say
age, the call will setStylesheetParam(" 21 ", "age"). Here 21 will not
be inside the single quotes. So this was the catch.
 
J

Joseph Kesselman

vaibhav said:
Regarding the passing of params to the XSLT processor, I have found out
that though setstylesheetparam() passes param value as a string, but
for passing the string value we have to enclose the value withing
single quotes.

The value is an XPath expression; hence the double-quoting requirement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top