RE: [xsl] Naming styles

Subject: RE: [xsl] Naming styles
From: xptm@xxxxxxx
Date: Fri, 20 Aug 2004 16:17:01 +0100
I usually tend to use camel case, too, be in vb style ("MasterTableName") or
java style ("masterTableName"), but i sometimes use "sql style" like
"MASTER_TABLE_NAME", so if i don't follow a rule but instead go on my mood
for
the day i usually get things a mess.

Quoting Andrew Welch <ajwelch@xxxxxxxxxxxxxxx>:

>
> > Are there any naming conventions in XSL/XSLT?
> >
> > In Java we have thos conventions, like class names begin with
> > a capital letter, methods and properties with lower letters, etc...
> >
> > Is there any "best practices " for XSL, for naming vars,
> > global vars, functions, etc.?
>
> If you've ever seen any of Demitre Novatchev's code you'll know he tends
> to use VB like naming convention s such as vFoo and pFoo for variables
> and parameters etc., but personally I'm not so keen on these.
>
> The filename isn't as important in XSLT as it is in java.  Templates
> tend to have matches rather than names, and so take care of themselves.
> All that's left are variables, parameters and keys, for which camel case
> normally suffices.
>
> I would welcome some conventions though, especially when it comes to
> formatting/indenting Xpath 2.0 in xslt:
>
> <xsl:template match="foo">
>   <xsl:value-of select="if ($x castable as hatsize)
>                             then $x cast as hatsize
>                             else if ($x castable as IQ)
>                             then $x cast as IQ
>                             else $x cast as xs:string"/>
> </xsl:template>
>
> (hopefully the indentations will make it through)
>
> Having attributes break across a single like has always felt wrong
> really, but the more exposure I have to it the more readable it becomes.
> In the first instance though, this looked a complete mess.
>
> cheers
> andrew
>
>







O SAPO ja esta livre de vmrus com a Panda Software, fique vocj tambim!
Clique em: http://antivirus.sapo.pt

Current Thread