On 4/21/07, Kendall Shaw <[EMAIL PROTECTED]> wrote: > Tatu Saloranta <[EMAIL PROTECTED]> writes: > > > --- Kendall Shaw <[EMAIL PROTECTED]> wrote: > > > >> Jirka Kosek <[EMAIL PROTECTED]> writes: > > ... > > You might want to check out JSON. It has bit more > > compact yet very simple textual notation, and has > > basic typing you need for expressing structs (string, > > int, boolean, lists, maps). There are couple of > > packages for exposing JSON via xml interfaces, too, if > > there's need for tool interoperability. > > Just an idea, > > Thanks, that's interesting, and I may even want to use it. I wonder > how many people will like JSON and still argue that Lisp is too hard > to read because of all the parenthesis.
If you are into lisp then there is sxml/ssax which is essentially a scheme version of JSON together with scheme api's (there is also LAML and BRL and a few others) It has also recently been ported to haskell. For python fans there is SLiP. There is also PyX, but that is a slightly different animal. Some of the more modern XML processing langukind of ages like XQuery and CDuce, have a kind of compact syntax a subluanguage. XSugar is an application for defining your own compact syntaxes and automatically generating bidirectional tools for transforming between and editing both versions of a document. Personally I am a very big fan of these kinds of things. I think traditional XML syntax is very good for document centric applications where most of the data is actually text nodes and you need an unambiguous way to escape out the metadata from the actual data, but for data centric applications, which is the bulk of what I see, traditional syntax introduces too much visual noise for human use and it is not really machine oriented either. Something like JSON or S-expressions or ... makes much more sense to me for that. You still get a universal data model withoutout the baggage, and you can automatically intertranslate traditional syntax when you need to. > But, I am still wondering if anyone has separated out the exact same > encoding that is used for transforming RNC into RNG, without occurance > operators etc., for use as a compact syntax for XML in general, most > likely where the XML is almost entirely markup. > You can write ++++++++++++++test.rnc+++++++++++++++ namespace x = "http://www.example.com/" x:a [x:b ["c"]] +++++++++++++++++++++++++++++++++++ and then trang -I rnc -O rng test.rn{c,g} and you get ++++++++++++++test.rng+++++++++++++++ <?xml version="1.0" encoding="UTF-8"?> <grammar xmlns:x="http://www.example.com/" xmlns="http://relaxng.org/ns/structure/1.0"> <x:a> <x:b>c</x:b> </x:a> </grammar> +++++++++++++++++++++++++++++++++++ So it seems like you can generate any XML, enclosed in a single outermost <grammar>. So all you should need is a little script to strip the outermost tags and move the xmlns attributes down one level and you have your generic preprocessor. D > Kendall > > > > > Yahoo! Groups Links > > > >
