[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RelaxNG schema validation - wildcard attributes andID type
Svante Schubert wrote: > The question is, does the tool have to act this way due to a specification? > > The most relevant spec seems to be: > http://www.oasis-open.org/committees/relax-ng/compatibility.html#id > But although I might misinterpret > http://www.oasis-open.org/committees/relax-ng/compatibility.html#IDAMYYR > I would say no. "A RELAX NG schema is compatible with this feature if and only if, after schema simplification, for each data or value element that specifies a datatype associated with a non-null ID-type, all of the following hold: ... if its attribute parent has any competing attribute elements, then each such competing attribute element has a data or value child specifying a datatype associated with the same ID-type." If you have wildcard pattern then attribute coming from it is competing with attribute of ID type. > But what if the test:id attribute should be used in this arbitrary content? > Does not "anyAttributes" refer to external attributes as well? It seems > strange that only the internal IDs are being checked and why doing this > check at all? > It is odd to add an exclude to every attribute/anyName of a Schema, > whenever a ID type attribute is being added. I agree that this is issue which beaten me also several times, but in many real world grammars it is sufficient to exclude just namespaces defined in schema from wildcard pattern for elements. For example schema for DocBook + MathML + SVG has to exclude those namespaces from wildcard pattern: namespace mml = "http://www.w3.org/1998/Math/MathML" namespace db = "http://docbook.org/ns/docbook" namespace svg = "http://www.w3.org/2000/svg" include "/path/to/docbook.rnc" { db._any.mml = external "mahtml/mathml2.rnc" db._any.svg = external "svg/svg11.rnc" db._any = element * - (db:* | mml:* | svg:*) { (attribute * { text } | text | db._any)* } } This approach work well the only problem is that name classes are not patterns so you have to redefine wildcard pattern each time, it is not sufficient to extend pattern for (db:* | mml:* | svg:*) itself. But such feature might be added into RELAX NG in the future, see: http://wiki.oasis-open.org/relax-ng/FutureRequirements -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@k... http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|