2 Jul 2004 20:22
attribute wildcards in open and extensible schemata
Robin Berjon <robin.berjon <at> expway.fr>
2004-07-02 18:22:32 GMT
2004-07-02 18:22:32 GMT
Hi, I've been working on defining a RelaxNG schema for the upcoming SVG 1.2, which in turn involves also creating schemata for sXBL, XLink, and XML Events. Many parts of these specs have open content models, where arbitrary elements with arbitrary attributes are allowed recursively. As you might expect, I keep hitting that problem where having an attribute wildcard creates a conflict with a declared attribute, and quite frankly it's driving me up the walls. I've read the solution offered in Eric's excellent book, but it really looks to me like it is a work-around trying to defeat the system than a real solution. I've also investigating the option of tightly coupling these schemata (excluding their namespaces from the open part of the model and reincluding them explicitly) but that's really ugly, and isn't an option as those schemata are meant to work together out of the box but live their separate lives in separate specs (at least sXBL and SVG are to be official, normative, and separate, and we intend to send our XML Events RNG to the HTML WG for inclusion in 1.1 in case they like it). Am I missing something? Is there a solution that I haven't thought of or missed in Eric's book? If not, would it be possible in future versions of RelaxNG to have something matching arbitrary attributes that haven't been matched already? It would be truly helpful for this whole compound documents shebang :) Or should I just give up and hop straight to NRL? Thanks for any insights,(Continue reading)
And I still don't know if there are any better solutions.
Using the entity, I lose error reporting line numbers inside the entity
(using jing/xmlbuddy), and when I'm still coding the entity this is a
nuisance.
But the entity solution also allows me to include a pattern without
enclosing it
within a grammar, thus allowing easier access to global defines as well as
the
defines of the grammar containing the entity reference.
Using the include element, error reporting is good. But I don't like
splitting a structure across two files just for the mechanics of the schema
language. I like such splitting to reflect a separation of logic. (And in
the actual schema I was working on, not this demo, I ended up using two
entities.)
RSS Feed