On 09/13/2015 11:35 PM, Leif Halvard Silli (russisk.no) wrote:

Apart from the "red flag", parsing and saving works OK, no?

Well, the "red flag" implies: XXE has entered its lenient mode, which makes it nearly unusable.




    We don't know how to do that, as data-* prefixed attributes cannot
    be expressed in any standard schema language.

 1.

    I suppose, then, that Validator.nu uses a non-standard schema … Or
    may be, like the OXygen team, Nuvalidator changed the Relax NG
    parser: http://www.oxygenxml.com/forum/topic7698.html

No, there is no way to do this using a custom schema of any standard kind. The only way to support data-* attributes is to filter them out just before validating the document.




 2.

    Michael Kay
    (http://lists.xml.org/archives/xml-dev/201205/msg00002.html) and C.
    M. Sperberg-McQueen
    
(http://stackoverflow.com/questions/27862244/validate-attribute-names-using-regular-expressions)
    on the other hand, says that XSD 1.1 does have support for this.
    Citing Sperberg-McQueen: «the task is straightforward in XSD 1.1
    with assertions: add an attribute wildcard to the complex type, and
    add an assertion along the lines of every $a in ./@* satisfies
    matches(name($n),'^(data-|att1$|att2$|...)') (not tested -- replace
    att1, att2 with the names of your 'normal' non-data attributes).»

* XSD 1.1 attribute wildcards do not allow to specify data-* attributes.

See http://www.w3.org/TR/xmlschema11-1/#Wildcards

* XSD 1.1 assertions are just like Schematron rules. Both technologies cannot be used to express the grammar of an XML vocabulary.

See http://www.w3.org/TR/xmlschema11-1/#cAssertions

* Anyway, XXE does not support XSD 1.1, only XSD 1.0.

See http://www.xmlmind.com/xmleditor/features.html#wxs




 3.

    Apart for those, advanced solutions, how about this: Let the user,
    in a (simple) way specify that the document may contain some
    /specific/ data-* attributes? For example, let’s say that I want to
    allow exactly data-leif="CDATA" in my document. (This is probably
    already possible, but only if I learn to handle a schema language.)

No, there is no simple way to do that. You would first have to create a custom XHTML5 schema and then a customization of the XHTML5 configuration which points to your custom schema.

Reference:

XMLmind XML Editor - Configuration and Deployment
5. Customizing an existing configuration
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/customizing.html




--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to