On Tue, Oct 21, 2003 at 09:12:27AM -0400, Dan Sugalski wrote: | We're talking about the first thing in a file (or stream, or whatever). I | was under the impression that XML files should be entirely composed of | valid XML, hence the need for the stream type marker being valid XML. YAML | doesn't care as much, so far as I understand, and for our own internal | binary format we cna do whatever we want.
As for 'autodetecting' XML vs YAML, an earlier version of the YAML spec restricted plain-style mapping keys so that they could not start with the '<' character. In this way, a processor could auto-detect if the incoming stream was XML or YAML, and use the appropriate parser. With the restricted schema described below, a small-footprint XML parser could even be shipped with the core libyaml allowing us (the YAML team) to handle this XML compatibility requirement; especially with regard to SOAP, the defacto XML object 'serialization' schema. I wrote up a brief 'sketch' as to one option for interoperability between XML and YAML, although there are many such options, and soon the yaml-core list will be forced to discuss icky things like this. My thoughts (which are _not_ concensus in the YAML community) are found at http://www.yaml.org/xml.html ; this page gives the usually "invoice" example in XML, and an imperfect XSLT stylesheet for converting XML in this schema to YAML. Clearly more work is needed here, I would very much like to hear your requirements. Kind Regards, Clark P.S. I try to follow this list, but I often miss items, so if you put 'YAML' in the title and cc me on it, it will surely get my attention.