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

Re: Change an XSLT top-level parameter

Subject: Re: Change an XSLT top-level parameter
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 9 Nov 2001 10:26:59 +0000
xsl top level parameter
David C. wrote:
> ah well in that case you don't mind editing the file to add the parameter
> (which was really what I was asking) so in that case what I do is invent
> myself a new namespace (say mailto:Robert.Stuart@xxxxxxxxxxxxxxxxx) and
> in the doument go

> <?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
> <top-level-element
>   normal-attribute1="x"
>   normal-attribute2="y"
>   xmlns:param="Robert.Stuart@xxxxxxxxxxxxxxxxx"
>   param:p1="val1"
>   param:p2="val2">

In the course of thinking about the point of embedded stylesheets, I
thought of the following possibility for the same kind of situation:

<?xml-stylesheet type="text/xsl" href="#localStylesheet"?>
<!DOCTYPE type-level-element [
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<top-level-element normal-attribute1="x" normal-attribute2="y">

<xsl:stylesheet id="localStylesheet" version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="stylesheet.xsl" />
<xsl:param name="p1" select="val1" />
<xsl:param name="p2" select="val2" />

<xsl:template match="xsl:stylesheet" />
                
</xsl:stylesheet>

...

</top-level-element>

This has the disadvantage of being a lot more long-winded but the
advantage of allowing you to set the parameter values to things other
than strings very easily.

This kind of per-document customisation of a stylesheet is the only
good reason I could think of for embedded stylesheets.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.