XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] RelaxNG schema validation - wildcard attributes andID types

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@kosek.cz      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
------------------------------------------------------------------

OpenPGP digital signature



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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS