Re: three proposed additions to sxml
Neil Van Dyke <[email protected]> Wed, 19 Mar 2014 22:19:07 -0400
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <[email protected]> |
Hello! I'm sorry for the delay responding. Thanks to everyone for thoughtful comments. [email protected] wrote at 03/19/2014 09:50 PM: >> If you are parsing XML and you see a parsed internal entity reference, >> you almost always want to have it expand out to a sequence of characters >> -- as the SSAX parser does. >> >> Perhaps Neil has a different use case, or I am misunderstanding. > This is indeed the confusion I have with that part of Neil's > proposal. Not only the XML Recommendation says that character entities > should all be expanded; it seems to be the most common and desirable > thing. Neil, could you clarify? My desire for notation like "(& rArr)" is for nice-looking handwritten SXML literals embedded within program source code. I work on some systems that have large amounts of such code. Regarding embedding Unicode characters in the code instead of XML entity references... In general, in source code, I only assume it's 7-bit printable ASCII clean. Even if all my own editors and other tools can handle UTF-8 perfectly, not everyone's tools can, nor can all email services. Regarding, as someone pointed out, in quasiquoted s-expressions, one could use comma to introduce these special characters (e.g., ",rArr" or ",right-double-arrow-char-string")... One problem I see with this are that it can be messy to look at, and error-prone (especially when not everyone working on literal SXML parts of the code is fully comfortable with Scheme). Another problem is that, since it uses quasiunquote and is not an explicit part of SXML, I don't see that it's a good fit for my "html-template" macros, which are a gentler alternative to quasiquoted SXML ("http://neilvandyke.org/racket-html-template/"). Regarding using Scheme strings within the "(& X)" form, rather than symbols and integers... I initially did that, but moved away from that because (& rArr) was more human-readable than (& "rArr"), especially considering that it's already a visually expensive way to represent a single character. Additionally, given that this "(& X)" would not be interpreted correctly by existing pure SXML standard tools, that a symbol or integer as the value would cause those tools to signal an error (rather than, perhaps, interpret as an element named "&" with content "X") is actually desirable. (I admit that my old HtmlPrag tools from 10 years ago have actually been doing some variation of nonstandard SXML "(& X)" all this time. As I'm updating my tools, I'd like to come clean and be fully SXML-compliant, without giving up the conveniences.) Neil V. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech