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] | [List Home]


Subject: Fw: [office-comment] Ambiguity problems caused by a:defaultValue


Forwarded by "MURATA Makoto (FAMILY Given)" <eb2m-mrt@asahi-net.or.jp>
----------------------- Original Message -----------------------
 From:    "MURATA Makoto (FAMILY Given)" <eb2m-mrt@asahi-net.or.jp>
 To:      office-comment@lists.oasis-open.org
 Date:    Sat, 10 May 2008 12:21:39 +0900
 Subject: [office-comment] Ambiguity problems caused by a:defaultValue
----

Dear colleagues,

While trying to explain the reason of the bug Alex pointed out, I find
an even severer problem.  I have not noticed it, since I never use
default values.

Before explaining the problem, let me say that this is arguably a
problem in the RELAX NG side.  I am not trying to offend the ODF camp
but rather feel that the RNG and ODF camps should try to overcome
the problem together.

Let's consider the problem.  It is about default values specified 
in RELAX NG schemas.

First, the default value feature a:defaultValue) is not
implemented by Jing.  As far as I know, a:defaultValue specified in
RELAX NG schemas are silently ignored by any of the RELAX NG validator.  
Some data-binding tools of RELAX NG (e.g., Relaxer) might use 
a:defaultValue.

Second, the ODF schema has an ambiguity problem about default values.
This problem is NOT detected by Jing.  This problem is similar to the
ambiguity problem about ID/IDREF, which was pointed out by Alex.

Let me show a schema having an ambiguity problem.

  namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
  start = foo1
  foo1 = element foo { 
          ([ a:defaultValue = "false" ] attribute id { text })?, foo2 }
  foo2 = element foo {   attribute id { text }? }

This schema does not satisfy the constraint in the last bullet of the
first itemized list of Section 3 in "RELAX NG DTD Compatibility".

>if the containing definition competes with another definition, then
>that other definition also contains an attribute element with the same
>name and with an a:defaultValue attribute with the same value.

In this schema, foo1 competes with foo2.  But foo2 does not specify 
a:defaultValue.

But Jing does not report anything.

bash-3.2$ !!
java -jar d:/james/jing-20030619/lib/jing.jar -c test.rnc test.xml
bash-3.2$ 

The ODF 1.0 schema has the same problem.  For example, 
consider

   [ a:defaultValue = "simple" ] attribute xlink:type { "simple" }

in the definition of office-meta-data.  This definition competes 
with anyElements (the last definition on the ODF 1.0 schema).  However,
anyElements does not specify a:defaultValue for the attribute 
xlink:type.

It is not easy to solve the problem by changing the definition of
anyElements (and that of mathMarkup).  It is not impossible.  But the
result will be more difficult to read.  However, a:defaultValue is
ignored after all.

I would propose to replace every a:defaultValue with a comment, which
indicates what application programs should do when the attribute is
absent.  I believe that this is exactly what ODF application
programmers are doing right now.


Cheers,

-- 
MURATA Makoto (FAMILY Given) <EB2M-MRT@asahi-net.or.jp>


-- 
This publicly archived list offers a means to provide input to the
OASIS Open Document Format for Office Applications (OpenDocument) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: office-comment-subscribe@lists.oasis-open.org
Unsubscribe: office-comment-unsubscribe@lists.oasis-open.org
List help: office-comment-help@lists.oasis-open.org
List archive: http://lists.oasis-open.org/archives/office-comment/
Feedback License: http://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
Committee: http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office

--------------------- Original Message Ends --------------------

-- 
国際大学
村田 真 <EB2M-MRT@asahi-net.or.jp>


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