[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: Abel Braaksma Online <abel.online@xxxxxxxxx>
Date: Tue, 09 May 2006 00:50:41 +0200
inthashmap downlaod
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, Michael,

Thanks for such quick replies. I wouldn't have expected it to be so rather easy/straightforward after having tried quite some dead-end paths. I see now in the interfaces and docs that there's quite some information about a variable or param, once you get a hold of it. This is great! Now I know that I would not be able to find this myself: it is not in the docs (but it is in the lib). This is a real time and code saver for us, thanks! :)

(strange: a search for getCompiledGlobalVariables returns 3 results on Google, of which none points to saxonica docs ;)

Cheers,
Abel

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.