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] Validation of a document during contruction


I have a working Relax NG validator based on James' validation notes.
This is fine for full document validation. However, my current problem
is to add
validation to a syntax driven xml editor. This is proving impossibly
difficult.

Task 1: can I add this element at a selected position within another
element?
Task 2: can I add this attribute to this selected element?

The shotgun approach is to update the document, validate the document,
and reverse all the above if the document is invalid. Unfortunately,
this does not work in the face of partially constructed documents. These
are likely to be invalid until required elements/attributes are entered.

A more considered approach would be to advance the validation as far as
possible with the data already entered. This would leave residuals at
each unresolved node. Where single choices remain then the validation is
clear. Where multiple choices remain - try to figure out what decides
those choices and ask the user to make a choice. For example, enter the
class="section"  or "subsection" attribute in the ancestor example
schema.

My problem is I don't have the intellectual tools to deal with the
slippery nature of Relax NG schemas.
1. Content can depend on attributes of parent elements.
2. Content can depend on the ancestry of parent elements.
3. I don't know if this is true, but can content of one element be
matched depending on the content of the dependents of some arbitrary
element relationship: sibling, cousin, 2nd cousin twice removed.

The problem seems to be that validity is a global property of a Relax NG
pattern. It is very hard to point to a single attribute or element and
say: If  X then Y else Z. Perhaps a certain value for a required
element, plus the presence of an optional attribute, but only when an
ancestor of a particular element you can enter a Z element here.

Question to this group: How best to proceed?



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


Powered by eList eXpress LLC