[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to retrieve global parameters names and their defa

Subject: How to retrieve global parameters names and their default values using Saxon?
From: Abel Braaksma Online <abel.online@xxxxxxxxx>
Date: Mon, 08 May 2006 20:58:03 +0200
defa timer
Dear subscribers,

I am a first timer to this list, so I hope to do it a bit right.

We are building a templating system where different data formats can be imported/exported in different other formats, multiple in/multiple out. We use XSLT 2.0 as our format definition language, describing either the input or the export format in it, using a middle format for our storage system where people can edit the contents in a transparent and user friendly interface.

To add to the achieved flexibility, tech-users can add there own import/export definitions using one or more XSLT files. When normal users use some import wizard, we want to present them the global parameters to override some default settings, like "cell-delimiter", "ignore-headers" etc, that were defined in the uploaded XSLT files using (root level) <xsl:param ...>

Question: How can this be achieved? Saxon provides a getParameter and a setParameter. But "getParameter" will not return the default value, and it is not possible to iterate through all available global parameters without knowing their names.

I have looked up the uses of the ParameterSet class, but could not find a way to get this scenario to work. One alternative could be to use XSLT (!) to retrieve all parameters by transforming the original XSLT(s), but how to deal with includes, imports and precedence?

My guess was: if there's a getParameter(), there is somewhere a getParameters() also. But there isn't, at least I couldn't find it. If anyone has an idea or a pointer, I would be very greatful!

I use: Saxon 8.7.1, without validation, with XSLT 2.0.

Sample XSLT (root tag removed):

<xsl:stylesheet version="2.0" ....>
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <!--- using includes and imports -->
  <xsl:include href="import-parameters.xslt" />
  <!-- some more parameters -->
  <xsl:param name="ignore-comments" select="'true'" />
  <xsl:param name="field-separator" select="';'" />
  <xsl:template match="/" >
      ... etc ...
  </xsl:template>
</xsl:stylesheet>


Thanks to you all for reading! 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-2013 All Rights Reserved.