Re: [xsl] single quotes instead of double

Subject: Re: [xsl] single quotes instead of double
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 21 Nov 2011 12:18:52 -0500
Hi,

On 11/21/2011 10:51 AM, Andrew Welch wrote:
Different companies have different stanards, sometimes
they agree with my approach, sometimes they don't.

If you know any existing XSLT coding standards, please post them (in a new thread), I'm genuinely trying to create a style guide.

Well, Mulberry has a style guide but it's just for us. :-)


Spaces or tabs is only
a problem if you have 2 people doing 2 different things or you like to set
your tabs at a different spacing, doesn't make one right or wrong.

Yep, the purpose is to avoid 2 people doing 2 different things, its all about consistency, not really about right and wrong.

There is a set of issues for which Mulberry commonly tells its clients "You need a rule, and you need to follow the rule. We like some rules better than others but it's more important that you have a rule and follow it than that you follow any particular rule".


Sometimes we then add "oh, and if you make a rule and then change it, you're not following any rule at all".

You have to indent your code somehow, so using 4 spaces is a fairly common way.

Personally I prefer two spaces, but I know that others feel differently.


Mulberry's rule for delimiting attribute values in our XSLT is probably closer to Ken's: while we prefer '"' (the double straight quote) out of habit and consistency in general, we also allow our developers a certain amount of flex as long as it favors legibility and intelligibility. So we'd be fine with single straight quotes around an attribute value (even just once) if the developer could avoid a more complicated workaround thereby.

But I'm not sure this rule is among our rules as documented. I guess we should add it. (We have rules about our rules but we don't always follow them.)

Cheers,
Wendell

======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread