XML overuse? (was Re: Python to XML to Python conversion)

Clark C . Evans cce at clarkevans.com
Tue Jul 16 14:27:12 EDT 2002


On Tue, Jul 16, 2002 at 03:18:30PM +0200, holger krekel wrote:
| Huaiyu Zhu wrote:
| > The basic idea is quite simple: consider a data structure as a tree; denote
| > the type of branching at each node; indent the subtrees.  It appears to me
| > that indentation is easier to handle than quotes and escapes.  Here's a
| > simple example:
| 
| It does and it's very interesting.  It does sound a lot like 
| http://yaml.org to me, though  (They even have an RFC).
| Don't you think YAML might be a superset of your ideas?

Yes, Steve Howell even has a python implementation of it...
http://yaml.org/python/PyYaml_14jul2002.tgz

I'm sure he'd love your comments/contributions.

| Let me add some random thoughts/questions about your/yaml's scheme 
| (i hope i am not missing something obvious):
| 
| - how is a binary data-stream's size determined? What about
|   open-ended streams?  Embedding of arbitrary data-streams
|   is very useful (IMO).

In YAML, we have a built-in BASE64 type which hopefully most
implementations will support.   As for handling embedded streams,
this works as long as they are indented properly and only use
printable characters (see specification).

| - somehow your and yaml's scheme remind me of todays wiki techniques.  
|   E.g. Wikis have methods of sequence-detection (bullets ...) and they
|   have a commitment to readability. Of course, they are generally more 
|   concerned with graphical views than with beeing a concise persistence
|   scheme.  

Yes; Ward Cunningham's WikiWiki is a very cool concept and I'm sure
we borrowed from it sub-conciously.

| - Is there a canonical conversion between XML and your scheme/YAML?
|   Shouldn't be too hard, anyway...

http://yaml.org/xml.html

| - how do you express external addresses akin XPATH? 
|   Ideas:
|     - Mappings are easy, just take the 'key'. 
|     - Sequences are easy (take the sequence number) but not very robust
|       to deletions and insertions of items.
|     - tag-names (IDs) which can be associated with any item might be interesting.
|       readability is likely to suffer, probably.

I'm toying with making IDs a "special" key so that a YPATH
like mechanism would work well... similar to XPATH/XSLT's "keys()"

| btw, I wonder whether some form of your and/or YAML's ideas should play a
| role in the new persistence-SIG.  While the actual persistence mappings 
| are not in the focus there are certainly some interesting connections 
| between the two areas.

One of our other members, Brian Ingerson, is working on getting
YAML into the core of Parrot (http://parrot-code.org)

| this sure is useful. Especially for me since i work with a (perl-) 
| friend on a project which needs to address the persistence-question. And
| we want to have it interoperable, simple and fast.  I guess looking
| at YAML might avoid that you have to dig too much into old harddisks :-)

Also, there is a Perl implementation of YAML sited in the 
downloads section of the website written by Brian Ingerson.
Having more members would be great!  We could use more implementations,
and generic YAML tools (like YAML-DIFF)

Best,

;) Clark

-- 
Clark C. Evans                   Axista, Inc.
http://www.axista.com            800.926.5525
XCOLLA Collaborative Project Management Software





More information about the Python-list mailing list