Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] enclosing attribute in single quote

From: Wendell Piez <wapiez@------------.--->
To: xsl-list@-----.------------.---
Date: 4/27/2009 9:56:00 PM
Dr Sperberg-McQueen,

At 11:45 PM 4/26/2009, you wrote:
>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"/>.

Yes, I suppose it's a bit harsh, but only a bit. Maybe not 
XML-that-is-not-XML, but hyper-XML.

>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.

Indeed, and I recognize the usefulness of application conventions (I 
hope my Balisage paper gets accepted); in fact I advocate them all the time.

But there's also a big difference between such a convention with 
respect to application semantics (where indeed such conventions are 
the grist of the mill) and such a convention that does nothing for 
semantics, but only restricts the tools that can be used.

I also acknowledge that there may be good reasons for such 
conventions (desperate hackers included), which is why I try to be 
nice (I do!). But (as you know) they should be well-controlled and 
carefully scoped, or they will bite you. The very fact that the OP 
had to ask XSL-List how to get a serializer to impose a non-standard 
syntactic restriction is an indication of something.

>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.)

Don't get me started on the confusion sown by namespaces into this 
area. (Which isn't meant as a criticism of namespaces, as I don't 
have an alternative to suggest. Just an observation.)

>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.

Or, as I said to the OP, write yourself a hyper-XML-syntax serializer 
that does what you want using the XSLT output method="text".

Start with Evan Lenz's XML-to-string converter 
(http://www.xmlportfolio.com/xml-to-string/), which will save you 
some work. Isn't this monstrous? (See, I can be pragmatic too. :-)

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@m...
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent