Le vendredi 18 août 2006 à 00:32 +1000, Rick Jelliffe a écrit :
> MURATA Makoto said:
>
> > Or, you might want to introduce two <grammar> elements within the
> > top-level <grammar>. The first sub-<grammar> includes B, while
> > the second sub-<grammar> includes C.
>
> But I thought Eric said there is a flat namespace with no scoping in RELAX
> NG.
There is a flat namespace with no scoping *per grammar*. That's what
makes the difference when you use externalRef but you can also design
schemas with embedded grammars without using externalRef.
> What difference does the grammar element make? My question still
> stands: is it an error to have patterns with the same name in the case
> above?
It's an error to have patterns with the same name in the same grammar
but different grammars have distinct namespaces.
> Unfortunately, I am getting more confused about this, not less. Especially
> when I see material on parentRef, I cannot figure out what it all means.
parentRef allows to make a reference to a pattern in the parent grammar:
"The parentRef pattern is a reference to a named pattern belonging to
the parent grammar—in other words, the grammar in which the current
grammar is included. The scope of a named pattern is usually limited to
the grammar in which they are defined. The parentRef pattern provides a
way to extend this scope and refer to a named pattern defined in the
parent grammar."
(http://books.xmlschemata.org/relaxng/ch17-77195.html)
> I
> feel like the material on RELAX NG has been written making some key
> assumption about something that I am not privy to...
I feel that you are trying to approach RELAX NG with the assumption that
it is similar to W3C XML Schema. You would probably be more comfortable
if you coud forget what you know about W3C XML Schema part 1 and
consider RELAX NG as something different than all what you've seen
before :) ...
> Is there any other good summary around?
>
> > You mentioned the combine attribute. I have always thought that
> > the combine attribute is useful only when different define elements
> > having the same name belong to different schema files. So, I am
> > very surprised at the ODF RELAX NG schema (a single-file schema
> > which heavily uses the combine attribute) and your suggestion
> > about the combine attribute. How do others feel?
>
> I am open for any suggestion. I guess I currently have three issues that I
> cannot find satisfactory answers for in the material online:
>
> 1) When dealing with multi-namespace documents with multiple schema
> documents, what should I use NVRL for and what should I use RELAX NG for?
> I am asking both about absolute capabilities and best practise.
NVRL is based on a totally different paradigm where you cut instance
documents into pieces and validate these pieces separately. This
principle works best when the namespaces that you are combining are
relatively loosely coupled (like SVG embedded in XHTML). RELAX NG alone
works best when the namespaces that you are combining are more tightly
coupled such as in ODF.
> 2) What is the scoping and visibility of pattern names in RELAX NG?
Through ref, the scope of a pattern is the grammar within which it is
defined. Through parentRef, a pattern is visible in the grammars
directly embedded in the grammar in which it is defined.
> What does ExternalRef do?
ExternalRef includes an external grammar (which is embedded in the
current one).
> When do name duplications cause errors?
When they are done in the same grammar without combine attributes (or
with conflicting combine attributes).
> 3) In the particular case of converting an XSD element that joins a
> substitution group whose head and type is in another namespace (and there
> for in another schema), what is the equivalent RELAX NG constructs?
There is no strict RELAX NG construct and you need to define one.
> Does
> the presence of these mean I cannot use NVRL to validate the branches
> separately?
I don't see why. NVRL is independent of the schema languages that you
use. It splits you document before it reach RELAX NG.
Eric
--
GPG-PGP: 2A528005
Carnet web :
http://eric.van-der-vlist.com/blog?t=category&a=Fran%C3%A7ais
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
-- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
This archive was generated by hypermail 2.1.8 : Thu Aug 17 2006 - 22:33:02 UTC