On Fri, Jul 05, 2002 at 06:21:16PM -0400, Steve Howell wrote:
| > <yaml xmlns:yaml="http://yaml.org"
| > yaml:str="http://yaml.org/str"
| > yaml:cce="http://clarkevans.com/boogle"
| > >
| > <one>value</one>
| > <two>239</two>
| > <typed yaml:type="str">1923</typed>
| > <explicit yaml:type="cce"
| > >Howdy, scalars like this
| > break indentation. But this
| > is why we have YAML, no?</explicit>
| > <saved yaml:anchor="001">value</saved>
| > <referenced yaml:alias="001" />
| > <_key>
| > <_>nested</_>
| > <_>key</_>
| > </_key>
| > <_value>ugly, but works</_value>
| > <_key>	<_key>
| > <_value>illegal qname</_value>
| > <sequence>
| > <_>one</_>
| > <_>two</_>
| > </squence>
| > </yaml>
| This is pretty tolerable looking XML, but the underscore tags for the
| sequence items might freak people out. It all depends on what the customers
| want to do with the XML, I guess. If nothing else, they can pump it into
| tools like XML-Spy and get a different view of the data.
You could use <_item> for each list item. The underscores
are needed since they are magical, I think just plain old
single underscore works the best beacuse it is small and
unobtrusive. My project exports look fairly good with it.
(no where as nice as the YAML, that's for certain).
The primary concern is that there needs to be a way to
detect if a given node is a mapping, sequence or scalar.
If it has a "_" element, then all children must be "_"
elements; otherwise if it has some other element, it is
a mapping; otherwise if it has just a text node it is
a scalar; otherwise if it is empty without a type it
is an error. To make typing easier, we should probably
add that default types are already declared so that
someone can use "str" without having to declare it.
We could use the -item for items; for example...
This has four problems, first it doesn't look magical
(which IMHO, is a good thing). Second, its kinda
repetitive and yucky. The third issue is what to do
when the parent itself is a list?
<node-item-item-item>Three levels deep!</node-item-item-item>
And the last problem: what do you do when the key isn't
a valid xml name? Aka, <_key> was used for the parent.
In our phone chat, you also suggested using plurals;
<people><person>... but this requires external information
to know what the singluar of people is; and also it would
only work if people used plurals for their keys containing
a sequence... in short, although it seems nice, it doesn't
seem to be general enough to work in an automated manner.
Thus... the <_> proposal.
I was thinking more along the line of Neil's suggestion...
as a FAQ and as a separate specification; yaml.org/xml