OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   FW: [xml-dev] Relax NG annoyances

[ Lists Home | Date Index | Thread Index ]

Bill de hÓra,


> > Why aren't defined patterns named with QNames? ...
> 
> How would this aid portability?

I'll give an (trivial) example that demonstrates.  Say I want to
validate against a custom version of XHTML that supports XLink.  I
include James Clark's Relax NG Schema for XHTML [1] and John Cowan's RNG
for XLink [2].  Both schemas are OK by themselves, however, including
them would give a conflict with start definitions and "title"
definitions.  The start definition would be expected; however, the title
definition is not obvious - it's defined in a small module [3] among
*many* definitions [4].  If I was combining two large languages (such as
XHTML and MathML), then it would be hard to find all of the conflicting
names.

Furthermore, requiring an edit of one or both included languages breaks
some OOD principles for code reuse [5].  However, if each schema
encapsulated its definitions in a namespace (not necessarily the
language's namespace) then the unique-name problem goes away.  


> Or, how do I import a namespace for validation purposes?

Here's how I imagine it.  Say the XHTML modules were left unchanged (no
namespace declaration; however, the XLink schema declared its
definitions at "http://lists.xml.org/.../msg01074.html"; also with no
prefix. Then I could make my new document (note that I just hacked this
together now with no testing):

<grammar xmlns:xlnk="http://lists.xml.org/.../msg01074.html";>
  <include href="XHTML Schema">
    <define name="Core.attrib">
      <ref name="id.attrib"/>
      <ref name="class.attrib"/>
      <ref name="title.attrib"/>
      <choice>
        <ref name="xlnk:simple" />
        <ref name="xlnk:extended" />
      </choice>
    </define>
  </include>
  <include href="XLink Schema">
    <start combine="choice">
      <ref name="html"/>
    </start>
  </include>
</grammar>

The software should handle the namespace/prefix conversion from the
XLink Schema to the importee-schema, (just as XSLT software does) I
imagine.  I.E. prefixes are remapped and unknown namespaces/prefixes in
the importee are automatically defined.  Definitions with no prefix
would act as they do now for compatibility, of course.


> IMO that's the Right Thing.

Could we agree to disagree on this point?  Besides, Len Bullard [6] told
me to do it myself, so I'll hack it in an XSL Transform as I did with
"RNG with classes" [7].


> > Why can't I do that in Relax NG?  I understand that it was designed
to
> > eliminate perceived annoyances with W3C XML Schema; however, Relax
NG
> > has a bunch of annoyances to call its own.  :-/
> 
> I don't these are they however!

Hu?  I don't understand.

L8r,
 
--
Jimmy Cerra

] "I have learned these days, never to limit
]  anyone else due to my own limited
]  imagination." - Dr. Mae C. Jemison

[1] http://www.thaiopensource.com/relaxng/xhtml/

[2] http://lists.xml.org/archives/xml-dev/200206/msg01074.html

[3] http://thaiopensource.com/relaxng/xhtml/modules/struct.rng

[4] http://thaiopensource.com/relaxng/xhtml/modules/

[5] http://www.objectmentor.com/resources/articles/ocp.pdf

[6] http://lists.xml.org/archives/xml-dev/200307/msg00042.html

[7] Although I changed the language drastically from the URI below, the
referenced one is the only public version I posted (mainly because I'm
lazy).  http://lists.xml.org/archives/xml-dev/200306/msg00800.html





 

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

Copyright 2001 XML.org. This site is hosted by OASIS