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

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

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


Subject: [relax-ng] compact syntax: feedback from RelaxNGCC



Nowadays, I'm working on RelaxNGCC (that is, both using it and
participating in the development.)

Okajima-san, who started RelaxNGCC, was (and maybe is) very in favor of
the compact syntax, but with the latest syntax, I find it very difficult
to use it with the compact syntax.

The primary reason of this is that we need to quote all PCDATAs inside
elements. Thus, whenever you write things like:

<cc:java>
  some.java(code,"text");
</cc:java>

one needs to write

cc:java [
  'some.java(code,"text");'
]

If you try to write things like

<cc:java>
  System.out.println(MessageFormat.format(
      "some pretty ''{0}'' code",
      new Object[]{"hairy"}));
</cc:java>

to the compact syntax, you'll see how hard it is.


The difference of the order of annotations/RELAX NG elements is another
reason. With the XML syntax, you write

<element name="foo">
  <cc:java>code();</cc:java>
  <empty/>
</element>

which makes it clear that the code will be executed *after* <foo> is
seen.

With the compact syntax, you write as

[ cc:java ["code();"] ]
element foo {}

and this obfuscates the abovementioned order relationship.





This makes me wonder what the use of annotation syntax is. We know two
use of RELAX NG annotation, ooRelax and RelaxNGCC; both don't work quite
well with the compact syntax.

Does this merely mean that those two applications are exceptions? Or is
there any room for the improvement?  I'm sorry for not being
constructive, but I couldn't think of any easy fix for these problems.


I do like the compact syntax, though. I oftentimes start writing a
schema by using the compact syntax, then convert it to the XML syntax
and maintain it from there on. This allows me to quickly write a fairly
large schema.

regards,
--
Kohsuke KAWAGUCHI
Sun Microsystems                   kohsuke.kawaguchi@sun.com



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


Powered by eList eXpress LLC