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

FW: Relax NG annoyances


relax ng xhtml
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


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.