[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

Subject: RE: How to retrieve global parameters names and their default values using Saxon?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 8 May 2006 20:59:12 +0100
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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.