On 18 Sep 2015, at 9:38, Hussein Shafie wrote:

On 09/18/2015 12:48 AM, Leif Halvard Silli (russisk.no) wrote:
On 17 Sep 2015, at 2:20, Hussein Shafie wrote:

In a nutshell, in XSD 1.1, first allow any attribute in the content model of all elements and then assert that the only allowed attribute names
are prefixed by "data-". Not very elegant and anyway would not help
XMLmind XML Editor which is grammar-driven.
   [... snip ...]
Limiting ourselves to XSD 1.0 only, then, by permitting any attribute
and setting processContents to "lax", the validator will check the
predefined attributes for validity - but as well allow undefined
attributes.
   [... snip ...]
I have checked that the above works in Xmplipfy
   [... snip ...]
For instance it barks if I do this: <hr hidden="hid" data-foo="bar" /> But it is silent if I do this: <hr hidden="hidden" data-foo="bar" />

Could this also work in XMLmind XML Editor?

Don't know. I need to test this to give you answer. However, the solution you suggest, foreign wildcard attributes intersecting the "normal attributes", is not adapted to the design of XMLmind XML Editor. See below.

Looking forward to your testing. ;-)

   [... snip ...]
Sorry but the solution you suggest, foreign wildcard attributes intersecting the "normal attributes", is not adapted to the design of XMLmind XML Editor.

Note that everything you said about "what about the possibility of allowing more" already works fine, but using foreign *namespaces*.

Had the (X)HTML5 designers chosen "data:" prefixed attributes instead of "data-" attributes, there would be no problem at all as XSD and RELAX NG can express this (assuming that in this hypothetical (X)HTML5, prefix "data" is bound to a namespace different from "http://www.w3.org/1999/xhtml";).

Judging from the examples given e.g. in the "official" XSD 1.0 primer, it seems like foreign namespace unknown attributes is what one has had in mind.

Yes, I know, "data-" attributes exist for historical reasons.

I’m not certain what you refer to. I did not contribute in the debate, I think, when data-* was added to the HTML5 spec. The only "history" I know is that for HTMl5, there was much opposition to foreign namespace extensibility. The status of data-* attributes is also a little bit adhoc it is mean to be an adhoc attriubute.
--
leif halvard silli
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to