Access to parameter list from comiled stylesheet

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Access to parameter list from comiled stylesheet

Andrew Welch
Mike,

I'm writing a little transformation utility for Saxon and I want to
allow the user to set the parameters for the transform.

I can discover the available parameters by extracting the values from
the stylesheets involved, but this becomes more complicated when there
are many imports/includes, duplicate names, import precedence etc.

Is there any way to discover the available parameters from Saxon once
the stylesheet has been parsed completely and all the difficult stuff
taken care of? :)

thanks
andrew


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Access to parameter list from comiled stylesheet

Michael Kay
The APIs here are subject to change. However, in Saxon 8.6 you can do

Executable exec = ((PreparedStyleSheet)templates).getExecutable();
IntHashMap map = exec.getGlobalVariableIndex();
Iterator iter = map.valueIterator();
while (iter.hasNext()) {
  Object var = iter.next();
  if (var instanceof GlobalParam) {
    ... you're in business ...
  }
}

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> andrew welch
> Sent: 08 November 2005 13:36
> To: [hidden email]
> Subject: [saxon] Access to parameter list from comiled stylesheet
>
> Mike,
>
> I'm writing a little transformation utility for Saxon and I want to
> allow the user to set the parameters for the transform.
>
> I can discover the available parameters by extracting the values from
> the stylesheets involved, but this becomes more complicated when there
> are many imports/includes, duplicate names, import precedence etc.
>
> Is there any way to discover the available parameters from Saxon once
> the stylesheet has been parsed completely and all the difficult stuff
> taken care of? :)
>
> thanks
> andrew
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Access to parameter list from comiled stylesheet

Andrew Welch
> The APIs here are subject to change. However, in Saxon 8.6 you can do
>
> Executable exec = ((PreparedStyleSheet)templates).getExecutable();
> IntHashMap map = exec.getGlobalVariableIndex();
> Iterator iter = map.valueIterator();
> while (iter.hasNext()) {
>   Object var = iter.next();
>   if (var instanceof GlobalParam) {
>     ... you're in business ...
>   }
> }

Thanks Mike, will give it a try.


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Access to parameter list from comiled stylesheet

Andrew Welch
> > The APIs here are subject to change. However, in Saxon 8.6 you can do
> >
> > Executable exec = ((PreparedStyleSheet)templates).getExecutable();
> > IntHashMap map = exec.getGlobalVariableIndex();
> > Iterator iter = map.valueIterator();
> > while (iter.hasNext()) {
> >   Object var = iter.next();
> >   if (var instanceof GlobalParam) {
> >     ... you're in business ...
> >   }
> > }
>
> Thanks Mike, will give it a try.

...and it works like a treat thanks!


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help