W3C home > Mailing lists > Public > public-diselect-editors@w3.org > April to June 2005

Use of & > and < in XML based language is confusing

From: Elliotte Harold <elharo@metalab.unc.edu>
Date: Thu, 05 May 2005 11:06:18 -0400
Message-ID: <427A366A.1030608@metalab.unc.edu>
To: public-diselect-editors@w3.org

The reserved characters should &, <, and > should not be used as 
operators in a language that appears in XML contexts. The double 
escaping this requires is hard to read and confusing. For instance, 
consider this:

<p sel:expr="di-cssmq-width('px') &gt; 200 &amp; di-cssmq-color() &gt; 0">
     <object src="image1" sel:selid="artimg42" sel:selidName="myns:myid"/>
</p>

Isn't this easier to understand?

<p sel:expr="di-cssmq-width('px') GT 200 AND di-cssmq-color() GT 0">
     <object src="image1" sel:selid="artimg42" sel:selidName="myns:myid"/>
</p>

I'm not sure AND, GT, and LT are necessarily the best alternatives to &, 
<. and >. That can be discussed. However we know from experience with 
XSLT and most especially URL query strings that using these three 
characters in attribute values confuses users and makes the langauge 
harder to learn and harder to use. Let's not repeat the mistakes of the 
past.

There's no need to overload reserved characters like this.

-- 
Elliotte Rusty Harold  elharo@metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
Received on Thursday, 5 May 2005 15:06:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:03 UTC