OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: [relax-ng-comment] Abbreviated compact syntax (Re: Compact syntax isnot compact enough. Why?)


Hi!

When the compact syntax first surfaced I suggested two simple syntactic
abbreviations that could be used in parallel with the current syntax to
improve
visual guidance. My suggestion didn't get much attention back then, but I'll
reiterate
the suggestion in this forum:

The keyword 'element' could be abbreviated by enclosing the name class in
'<' and '>'.
The keyword 'attribute' could be abbreviated by preceding the name class by
an at sign:

element foo { } would be abbreviated as <foo> { }
attribute foo { } would be abbreviated as @foo { }

The example in Paul's post would then become:

<library>
{
  <book>
  {
    @id {text}, @available {text},
    <isbn> {text},
    <title> {@xml:lang {text}, text},
    <author> {@id {text}, <name> {text}, <born> {text}, <dead> {text}?}*,
    <character> {@id {text}, <name> {text}, <born> {text}, <qualification>
{text}}*
  } +
}

which is more compact indeed, and in my opinion easier to read.

Cheers,
David

Paul T wrote:

> I took  the sample of Relax NG non-xml syntax
> from
>
> http://books.xmlschemata.org/relaxng/RngBookNonXmlSyntax.html
>
> element library {
>   element book {
>    attribute id {text},
>    attribute available {text},
>    element isbn {text},
>    element title {attribute xml:lang {text}, text},
>    element author {
>     attribute id {text},
>     element name {text},
>     element born {text},
>     element dead {text}?}*,
>    element character {
>     attribute id {text},
>     element name {text},
>     element born {text},
>     element qualification {text}}*
>   } +
> }
>
> Applying tersexml notation
> ( http://groups.yahoo.com/group/tersexml/message/15 )
> it could be written as
>
> library {
>     book [ id = text   available = text  ] {
>             isbn { text }
>             title [ xml:lang = text  ] {
>                     text
>             }
>             author [ id = text  ] {
>                     name { text }
>                     born { text }
>                     dead { text } ?
>             } *
>             character [ id = text  ] {
>                     name { text }
>                     born { text }
>                     qualification { text }
>             } *
>     } +
> }
>
> Or, keeping the spirit of current relax NG
> it could be  ( I don't like it, but still ... ) :
>
> library {
>     book [ id { text }  available { text } ] {
>             isbn { text }
>             title [ xml:lang { text }  ] {
>                     text
>             }
>             author [ id { text }  ] {
>                     name { text }
>                     born { text }
>                     dead { text } ?
>             } *
>             character [ id { text } ] {
>                     name { text }
>                     born { text }
>                     qualification { text }
>             } *
>     } +
> }
>
> 1. What are the problems of those terse notations,
> comparing to current notation ( which is not
> terse enough, from my point of view ).
>
> I'm sure that this question has been asked
> already, because  I can't belive people enjoy
> writing
>
> element a { text }
>
> instead of just
>
> a { text }
>
> 2 ... What was the resolution ( if any ) last time
> when this question has been asked?
>
> Rgds.Paul.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC