[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: enclosing attribute in single quote

Subject: Re: enclosing attribute in single quote
From: "C. M. Sperberg-McQueen" <cmsmcq@xxxxxxxxxxxxxxxxx>
Date: Sun, 26 Apr 2009 21:45:04 -0600
Re:  enclosing attribute in single quote
On 21 Apr 2009, at 16:48 , Wendell Piez wrote:

I take it the recipient of the data knows that by requiring XML with only single quotes used as attribute value delimiters, they are asking for XML-that-is-not-XML?

Well, that's kind of harsh, isn't it? XML does allow single quotes to be used, so <a x='y'/> is every bit as much a conforming XML document as <a x="y"/>.

If memory serves, ISO 8879 referred to rules of this kind as
"application conventions".  So they have always been part of the
story of generic markup.

And while those of us who work day to day with XML-based tools may
regard it as unnecessary, a convention of this kind can make things
easier for the desperate Perl hacker.  The DPH can often exploit
knowledge of regularities in the data at hand to get by with less
effort than would otherwise be necessary.  (In my work with the
XML Schema spec, for example, I routinely exploit the fact that I
know that all attributes use double quotes to simplify search and
replace expressions in my editor.  It's not Perl, so I'm not really
a DPH.  Call me a desperate ELisp hacker.)

Frankly, if the naming and design rules for prominent XML
vocabularies can require the use of specific namespace prefixes
for specific namespaces, and expect to elicit conformance instead
of incredulous laughter, well, then I guess application conventions
are alive and well and living among us. (I confess that my response
was incredulous laughter, but that didn't persuade them to change
the rules.)

There may well be SAX serializers which accept an invocation-time
parameter to prefer single quotes when emitting attribute values
(I've never looked so I don't know).  If there aren't, it really
shouldn't be too very hard to write one, to pair it with a SAX
parser, and to put together a filter that will normalize any
XML input by emitting it with single quotes only around attributes.



--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.