this is a german Web-Mirror of MHONARC.ORG powered by Domainunion AG

[Top] [All Lists]

Re: [xsl] best boolean practice

2013-07-30 13:05:13
At 2013-07-31 03:54 +1000, Terence Kearns wrote:
Just a quickie. I'm writing some code to produce XML which will later
be transformed and selected on, and I am wondering what will be the
best way to represent boolean values as far as XSL designers are


does it even make a difference at all?

If you are using schema validation, then in the lexical space "1" and "true" represent true(), and "0" and "false" represent false() ... nothing else.

If you are not using schema validation, consider your audience and consider the concept.

Then consider how the concept is presented to the audience:




but there is nothing really wrong with:


I'm thinking attributes will definitely be more intuitive than
elements. Am I right?
So this is not quite as good <value>yes</value> (certainly uses up
more characters).

Depends really on how you've represented other concepts in your document model. Being consistent to your users is, to me, the governing factor since you can put a string value in either an attribute or an element. Do you use attributes for other unstructured string values?

There really isn't a right or wrong way ... consider how your choice will be accepted by your XML users and put the burden on your stylesheet writers to accommodate that.

I hope this helps.

. . . . . . . Ken

Public XSLT, XSL-FO, and UBL classes in the Netherlands     Oct 2013 |
Public XSLT, XSL-FO, UBL and code list classes in Australia Oct 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: |
Crane Softwrights Ltd.   |
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com 
Google+ profile: |
Legal business disclaimers: |

XSL-List info and archive:
To unsubscribe, go to:
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>

<Prev in Thread] Current Thread [Next in Thread>