[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RelaxNG schema validation - wildcard attributes andID type

  • From: Jirka Kosek <jirka@k...>
  • To: Svante Schubert <Svante.Schubert@S...>
  • Date: Tue, 09 Oct 2007 22:32:45 +0200

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
------------------------------------------------------------------

OpenPGP digital signature



[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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.