[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
On 21 Apr 2009, at 16:48 , Wendell Piez wrote:
Re: [xsl] enclosing attribute in single quote
Subject: Re: [xsl] enclosing attribute in single quote From: "C. M. Sperberg-McQueen" <cmsmcq@xxxxxxxxxxxxxxxxx> Date: Sun, 26 Apr 2009 21:45:04 -0600 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] enclosing attribute in si, Wendell Piez | Thread | Re: [xsl] enclosing attribute in si, Wendell Piez |
Re: [xsl] [xslt performance for big, Robert Koberg | Date | Re: [xsl] creating of id and refid, Ganesh Babu N |
Month |
Keywords