You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Luca Orlandi <lu...@inferentia.it> on 2000/12/18 15:54:52 UTC

[Enhancement] XSL Taglib

I've greatly appreciated the xsl taglib (I've developed myself something
similar using a simple servlet hierarchy ) and I would like to enhance it
introducing the support for parametric xsl.
I'm in doubt about the best interface for it:

<xsl:apply ...>
	<xsl:params>
		<param name="xxx">value1</param>
		...
	</xsl:params>
</xsl:apply>

This could be a solution but somehow collides with the "nested xml" syntax:

<xsl:apply xsl="/xml/employeeList.xsl">
<?xml version="1.0" encoding="ISO-8859-1"?>
<employees>
  <employee id="123">
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <telephone>800-555-1212</telephone>
  </employee>
</employees>
</xsl:apply>

So a better solution could be forcing the uso of a "parameter bean"

<xsl:params name="mypar">
	<param name="xxx">value1</param>
	...
</xsl:params>

Tha bean can then countain a hash of params to be used prior to process-ing
the XSL+XML.

Any suggestions?

---
Luca Orlandi  - Inferentia Spa MI (I)
Phone: +39 0259928451 - Fax: +39 02 59928221

Re: [Enhancement] XSL Taglib

Posted by Marius Scurtescu <ma...@multiactive.com>.
Hi Luca,

I run into the same problem some while ago. I
ended up by implementing a "param" tag and I
sent it to this list. May be I should of sent/put
it somewhere else, I don't know.

A few other people asked about a mechanism to
pass parameters to the XSLT processor, but I
have no idea if the commiters are working/
considering this. Some feedback would be great.

Regards,
Marius

PS I sent you directly the source code and the 
original message regarding my "param" tag.

Luca Orlandi wrote:
> 
> I've greatly appreciated the xsl taglib (I've developed myself something
> similar using a simple servlet hierarchy ) and I would like to enhance it
> introducing the support for parametric xsl.
> I'm in doubt about the best interface for it:
> 
> <xsl:apply ...>
>         <xsl:params>
>                 <param name="xxx">value1</param>
>                 ...
>         </xsl:params>
> </xsl:apply>
> 
> This could be a solution but somehow collides with the "nested xml" syntax:
> 
> <xsl:apply xsl="/xml/employeeList.xsl">
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <employees>
>   <employee id="123">
>     <first-name>John</first-name>
>     <last-name>Doe</last-name>
>     <telephone>800-555-1212</telephone>
>   </employee>
> </employees>
> </xsl:apply>
> 
> So a better solution could be forcing the uso of a "parameter bean"
> 
> <xsl:params name="mypar">
>         <param name="xxx">value1</param>
>         ...
> </xsl:params>
> 
> Tha bean can then countain a hash of params to be used prior to process-ing
> the XSL+XML.
> 
> Any suggestions?
> 
> ---
> Luca Orlandi  - Inferentia Spa MI (I)
> Phone: +39 0259928451 - Fax: +39 02 59928221

-- 
------------------
Marius Scurtescu, Software Engineer
Tel: (604) 899-2835 Fax: (604) 899-2899
mailto:marius@multiactive.com
Multiactive Software Inc. http://www.multiactive.com
------------------
Attract and retain customers with Multiactive Software --
proud winners of PC WEEK's "Best of COMDEX" award.
------------------

Re: [Enhancement] XSL Taglib

Posted by Eduardo Pelegri-Llopart <Ed...@eng.sun.com>.
I guess I'd go with the some variation of the second so you can reuse
the concept in other tags later on.

BTW, I am assuming your second looks like:

 <util:params name="...">
   <util:param> ...
 </util:params>

with "util:param" instead of "param"

or maybe even
 <util:params name="....">
   <util:param name="xxx" value="...."/>
   <....
 </util:params>

Some of the core tags use your 1st approach, but we didn't want to add
any more concepts to the core tags in 1.{0,1,2} and instead left new
concepts for futher experimentation elsewhere.

	- eduard/o

Luca Orlandi wrote:
> 
> I've greatly appreciated the xsl taglib (I've developed myself something
> similar using a simple servlet hierarchy ) and I would like to enhance it
> introducing the support for parametric xsl.
> I'm in doubt about the best interface for it:
> 
> <xsl:apply ...>
>         <xsl:params>
>                 <param name="xxx">value1</param>
>                 ...
>         </xsl:params>
> </xsl:apply>
> 
> This could be a solution but somehow collides with the "nested xml" syntax:
> 
> <xsl:apply xsl="/xml/employeeList.xsl">
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <employees>
>   <employee id="123">
>     <first-name>John</first-name>
>     <last-name>Doe</last-name>
>     <telephone>800-555-1212</telephone>
>   </employee>
> </employees>
> </xsl:apply>
> 
> So a better solution could be forcing the uso of a "parameter bean"
> 
> <xsl:params name="mypar">
>         <param name="xxx">value1</param>
>         ...
> </xsl:params>
> 
> Tha bean can then countain a hash of params to be used prior to process-ing
> the XSL+XML.
> 
> Any suggestions?
> 
> ---
> Luca Orlandi  - Inferentia Spa MI (I)
> Phone: +39 0259928451 - Fax: +39 02 59928221