Altova Mailing List Archives

RE: [xsl] Naming styles

From: xptm@-------
Date: 8/20/2004 3:21:00 PM
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
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:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.