[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: initial template parameters
mmm... another useful lesson learned ;-) Thx for that info Martin. -----Original Message----- From: Martin Honnen [mailto:Martin.Honnen@xxxxxx] Sent: Thursday, March 18, 2010 4:02 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: initial template parameters Robby Pelssers wrote: > Or you would have to keep a package folder structure like most programming languages do and even in javascript it is an adopted approach to create namespace like structures to have no clashes in variable names. > > > Com.mycompany.xslt.pdf > - content2pdf.xslt > > <xsl:param name="com_mycompany_xslt_pdf_content2pdf_param1" select="'defaultvalue'"/> > > > Com.mycompany.xslt.html > -content2html.xslt > <xsl:param name="com_mycompany_xslt_html_content2html_param1" select="'anotherdefaultvalue'"/> > > So if you would include both xslt's in another main.xslt you would at least have no confusion about parameters. > > I have to say I don't follow this approach myself because I can oversee and am the only maintainer of the stylesheets. But if you were to write xslt's which would be used by 3rd parties this might not be such a bad approach. > > What do you all think? A parameter can have a qualified name so I would rather define some namespace in the stylesheet and put the parameter name in that namespace <xsl:stylesheet xmlns:pdf="http://example.com/pdf" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="pdf:param1"/> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|