|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to retrieve global parameters names and their
> Use:
>
> compiledStylesheet = stf.newTemplates(new
> StreamSource(stylesheetPath));
> Executable exec =
> ((PreparedStylesheet)compiledStylesheet).getExecutable();
> IntHashMap map = exec.getCompiledGlobalVariables();
> Iterator iter = map.valueIterator();
> while (iter.hasNext()) {
> Object var = iter.next();
> if (var instanceof GlobalParam) {
> String name = ((GlobalParam)var).getVariableName();
> String value =
> ((GlobalParam)var).getSelectExpression().toString();
>
> cheers
> andrew
Thanks Andrew. It's not as bad as I remembered it ;-)
One caveat here is that toString() won't decompile a complex expression. But
the select expression of a xsl:param will in most cases be a literal, so you
should be OK.
Michael Kay
http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








