Hi Rick,
Le jeudi 17 août 2006 à 02:44 +1000, Rick Jelliffe a écrit :
> I am converting Microsoft's Office Open XML Schemas from XML Schema format
> to Relax NG compact syntax, for them to use in the proposed ISO standard.
> The XSD would still be the normative one. (It is an external spec to ISO,
> so no control there.)
Sounds like a good idea!
> Their schema makes use of almost everything nasty in XML Schemas :-)
>
> I have a few problems I need to resolve. The first one I'd like advice on
> comes down to this:
>
> * What is the best way to specify, in RELAX NG, that the local element
> being defined substitutes for a pattern in imported schema?
> <xs:element name="xxx" substitionGroup="elsewhere:something" />
>
> I know about combining definitions within a grammar. But what about
> included grammars with other namespaces?
I am not sure I understand what you mean by "grammars with other
namespaces". Grammars (and patterns) do not belong to a namespace in
RELAX NG! The notion of namespace for RELAX NG is pretty much limited to
restricting name classes (and resolving QNames).
> I see two possible approaches (are there more?) but I am not convinced
> either are legal:
>
> 1) Move all that kind of substitutionGroup definition inside the relevant
> rng:include element,
>
> <rng:include href="elsewhere.rng"
> ns="http://...elsewhere..." >
> <rng:define name="something" combine="choice">
> <rng:element name="xxx" ns="original" />
> </rng:define>
> </rng:include>
That wouldn't do what you want to do: definitions within a rng:include
replace the corresponding definitions in the grammar that is being
included.
> 2) Don't do any rearrangement, but just try to extend the pattern from
> the other namespace.
>
> <rng:define name="something" combine="choice"
> ns="http://...elsewhere..." >
> <rng:element name="xxx" ns="original" />
> </rng:define>
>
> Now I am sure that second one is wrong.
What do you mean by "wrong"? This does combine the definition of the
pattern named "global" to any other definitions of patterns with the
same name!
> I think the @ns only affects the
> element names inside its scope,
Yes, that's right.
> and doesn't resolve patterns to different
> namespaces.
Again, what do you mean by "patterns to different namespaces"?
<define name="a" ns="foo"/>
and
<define name="a" ns="bar"/>
are considered to be the same pattern.
I have tried to cover all that stuff in my book:
http://books.xmlschemata.org/relaxng/relax-CHP-10-SECT-2.html
> And it is made more complicated by the fact that the elements being added
> in the substitution group have a type belonging to the original
> substitution head.
>
> Any ideas?
Can't what I have suggested after an exchange on XML-DEV help?
http://eric.van-der-vlist.com/blog/2814_RELAX_NG_and_W3C_XML_Schema_compared_%28continued%29.item
Eric
> Rick Jelliffe
> --
> 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)
>
>
--
GPG-PGP: 2A528005
Le premier annuaire des apiculteurs 100% XML!
http://apiculteurs.info/
------------------------------------------------------------------------
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 - 06:53:02 UTC