[OpenAjaxIDE] Widget Metadata Schema questions ...

Jon Ferraiolo jferrai at us.ibm.com
Mon Aug 4 13:14:38 PDT 2008

Hi Kin,
I'll answer your questions in reverse order.

Regarding the schema language, I expressed the schema using RelaxNG Compact
Syntax (RNC) [1] instead of the (more verbose) RelaxNG (RNG) because
because RNC allows schema compact snippets that can be inserted into the
specification (thereby keeping the spec smaller and more readable) and
allows the use of DTD-like syntax for common things:

? => for optional things
* => for zero or more occurrences
+ => for one or more occurrences
() -> for grouping

I should emphasize that RNC is just a different syntax for the same
features as RNG.

Regarding *everything* in the schema being optional, yes, that should be
discussed. What I have found in prior language definition efforts is that
required attributes and elements tend to make things more complicated to
specify and implement and that it is *usually* (a different word than
"always") better for all concerned when attributes and sub-elements are
optional with a reasonable default value in case they are not provided;
otherwise, you get into messy questions about error handling when a
required attribute is not specified. However, I may have gone too far with
the whole optionality thing. There are a small number of places where it is
just doesn't make sense when a particular attribute or sub-element is
missing. For example, it does indeed look as if <property> must have a
'name' attribute because there does not seem to be a reasonable default
value if it is not specified. Same thing for 'name' on <field>, <method>,
and <parameter>. Also, as you say, the 'type' attribute on <required> also
should be required. Let's talk about this on Tuesday. I would like to do a
full-pass review of the language schema to see if other attributes or
sub-elements should be required.

Regarding the 'src' attribute on <require>, actually that isn't always
required. When you have <require type="javascript"> or <require
type="css">, it is possible that the 'src' attribute is missing and the
content is inline (i.e., within the <require> element).

I think 'datatype' should stay optional. We decided that 'datatype'
defaults to "String", which is appropriate for a large percentages of
cases. No need to force people to say datatype="String" for those cases.


[1] http://www.oasis-open.org/committees/relax-ng/compact-20021121.html

             "Kin Blas"                                                    
             <jblas at adobe.com>                                             
             Sent by:                                                   To 
             ide-bounces at opena         <ide at openajax.org>                  
             jax.org                                                    cc 
             08/04/2008 10:12          [OpenAjaxIDE] Widget Metadata       
             AM                        Schema questions ...                

So I was just taking a look at the <require> and <properties> element
schemas and noticed that *all* attributes for those nodes are optional?


require_element = element require {
    require_content  &  require_attributes  &  foreign_nodes
require_content = (
  preload_element?  &  postload_element?
require_attributes = (
  includeRef?  &  library?  &  minVersion?  &  name?  &  src?  &  target?
&  type?


property_element = element property {
  property_content  &  property_attributes  &  foreign_nodes
property_content = (
  option_element*  &  options_element?  &
  descriptive_elements  &  compatibility_elements
property_attributes = (
  datatype?  &  default_attribute?  &  hidden?  &  name?  &  readonly?  &
  required?  &  scope?  &  transient?  &  urlparam?  &  visibility?  &
  datatype_supplemental_attributes  &  pattern_attributes  &

Shouldn’t the <require> element require a “type” and “src” attribute? For
the <property> element, shouldn’t “name” and “datatype” be required?

Also, is this syntax a modified form of the RelaxNG syntax? Or is this a
homegrown syntax? It looks like relaxNG, but things like the “element” and
“attribute” keyword seem to be missing.

--== Kin ==--_______________________________________________
IDE mailing list
IDE at openajax.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080804/f96ccd2b/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080804/f96ccd2b/attachment-0003.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic11125.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080804/f96ccd2b/attachment-0004.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080804/f96ccd2b/attachment-0005.gif 

More information about the IDE mailing list