tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Ikeda <anthony.ik...@proxima-tech.com>
Subject URGENT: RE: param tag and other suggestions
Date Thu, 30 Nov 2000 04:33:47 GMT
My virus checker found this on this e-mail:

Antigen for Exchange found param.zip->xsl.jar infected with
CorruptedCompressedFile virus.
The file is currently Detected.  The message, "param tag and other
suggestions", was
sent from Marius Scurtescu  and was discovered in IMC Queues\Inbound
located at TradePayment.com/TP/FUJI.



Anthony Ikeda,
Web Application Developer,
Proxima Technology,

Level 13,
181 Miller Street,
North Sydney
Australia


PH: +612-9458-1718
Mob: 041 624 5143


> -----Original Message-----
> From: Marius Scurtescu [mailto:marius@multiactive.com]
> Sent: Thursday, 2 November 2000 11:37 AM
> To: taglibs-dev@jakarta.apache.org; taglibs-user@jakarta.apache.org
> Subject: param tag and other suggestions
> 
> 
> Hi,
> 
> I run into a problem with the 'apply' tag: there is no way
> specify a stylesheet parameter.
> 
> By looking at the source code I realized that it would be 
> quite easy to add this functionality, and since I needed
> it I decided to implement it.
> 
> The way I solved the problem is by adding an extra tag,
> called 'param', which is supposed to be used only directly
> inside an 'apply' tag. This 'param' tag will get the stylesheet
> parameter name and value and pass them to the 'apply' tag.
> The 'apply' tag will set these parameters, if any, to the
> XSLT processor just before doing the processing.
> 
> An example:
> <xsl:apply xml="some.xml" xsl="some.xsl">
>   <xsl:param name="name1" value="value1"/>
>   <xsl:param name="name2" param="reqname"/>
> </xsl:apply>
> 
> The parameter value can be specified in two ways: directly
> with the 'value' attribute or by referencing a request
> parameter with the 'param' attribute.
> 
> I added tow classes to the package: ParamTag and ParamTEI.
> ApplyTag was slightly modified. It has a method, setParam,
> through which one can add parameters and these parameters
> are applied before processing. I added a comment starting
> with "// marius:" where I modified ApplyTag.
> 
> Is there a process in place through which I could get
> commit rights?
> 
> The attached zip files contains the added and modified
> source code and tld and also the compiled code if you
> want to try this out.
> 
> A few other suggestions and comments:
> 
> - the "xml" attribute of the apply tag is not very useful,
> it will try to locate an xml file in the folder where the
> application is installed but any realistic xml file will not
> reside there
> 
> - the body of the 'apply' tag can contain the actual xml file
> and this does not make much sense; the xml part of the
> transformation is the most likely to be the dynamic one and
> you would not hard code it into your jsp file; it would make
> all the sense in the world to hardcode the xsl file since
> this represent style just as jsp does
> 
> - I suggest adding two new tags: xml and xsl; these tags
> would be used inside the apply tag and will offer an
> alternative to hardcode the xml and xsl content
> 
> An example using the xsl:
> <xsl:apply xml="some.xml">
>   <xsl:param name="name" value="xxx"/>
>   <xsl:xsl>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <xsl:stylesheet version="1.0" xmlns:xsl="...">
>       <xsl:output method="html" indent="yes"/>
>       ...
>     </xsl:stylesheet>
>   </xsl:xsl>
> </xsl:apply>
> 
> If these tags are used then the body of 'apply' can be always
> ignored and the xml and xsl data would be set by these
> inner tags.
> 
> It would also make sense to create an ApplyTEI class to deal 
> with the arguments instead of doing this in the ApplyTag itself.
> 
> I apologies if some of my observations are stupid due
> to ignorance, I am new to this list and to xsl.
> 
> Regards,
> Marius
> 
> -- 
> ------------------
> 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.
> ------------------
> 

Mime
View raw message