More comments Level 3 Validation/Edit

ElementEditVal.allowedChildren isn't all that useful.  What you really 
would want is a list of all the element names (and maybe #text if 
character content would be allowed) that could appear as the initial 
child of the element.  If you had a content model like (j, 
(a|b|c|d|e|f|g|h|i|k|m|n|o|p)) you would want to guide the user to start 
a <j> element.  Once you had that inserted, you could use 
NodeEditVal.allowableNextSiblings to guide through the rest of the 
content model.

ElementEditVal.allowedAttributes is good, but it would also be helpful 
for have an ElementEditVal.requiredAttributes and maybe an 
ElementEditVal.fixedAttributes.

It would be useful if DocumentEditVal had a method that took a value 
from a NameList from  allowedChildren, allowedNextSiblings, et al and 
created the corresponding node.  The format of the NameList entries is 
not described, but without such a method, it would be necessary to parse 
the entry into the namespace and local name and then call the 
corresponding CreateElement or CreateElementNS.

Something like:

Node CreateNode(string nameListName)

where if nameListName was '@foo', you'd get an attribute, if 
nameListName was #text, you'd get a CharacterDataNode and if 
'transform:http://www.w3.org/1999/XSL/Transform", an XSLT transform 
element and if "foo" a DOM L1 element.

That would suggest that allowedAttributes should return the attribute 
values starting with a "@".  You'd also need to specify how you'd 
represent namespace qualified attributes.

Received on Thursday, 13 February 2003 01:40:30 UTC