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

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RELAX NG extension proposal -- nameClass as a pattern


Hi,

there is my proposal for possible change to RELAX NG. I would like to 
see if nameClass could work much more like ordinary pattern.

The current definition is:

nameClass	  ::=  	<name> QName </name>
			| <anyName> [exceptNameClass] </anyName>
			| <nsName> [exceptNameClass] </nsName>
			| <choice> nameClass+ </choice>
exceptNameClass	  ::=  	<except> nameClass+ </except>

This means that you are not allowed extend existing nameClasses with |= 
or &=. This is useful if you create schemas for compound documents and 
you have pattern for element from any foreign namespace.

For example in plain DocBook you have pattern:

namespace html = "http://www.w3.org/1999/xhtml";
namespace mml = "http://www.w3.org/1998/Math/MathML";
namespace db = "http://docbook.org/ns/docbook";
namespace svg = "http://www.w3.org/2000/svg";

db._any =
   element * - (db:*) {
     (attribute * { text }
      | text
      | db._any)*
   }

which can be used in places where you want to allow arbitrary foreign 
content. If you now want to create schema which allows XHTML and SVG 
inside DocBook you must redefine whole db._any pattern as:

db._any =
   element * - (db:* | html:* | svg:*) {
     (attribute * { text }
      | text
      | db._any)*
   }

What I would like is to be able to use named pattern for definition of 
list of name classes. For example:

tns = db:*

db._any =
   element * - (tns) {
     (attribute * { text }
      | text
      | db._any)*
   }

Then if I want to extend schema with XHTML and SVG, I have to exclude 
these namespaces from db._any pattern. I can just simply extend existing 
tns pattern:

tns |= html:* | svg:*

I haven't been thinking in a detail about changes to syntax and 
semantics of RELAX NG that have to be done in order to accomodate this 
funcitonality. First I would like to know what others think about this 
extension.

I faced this problem twice. Once when I was working on schemas which 
combine DocBook + SVG + MathML (see 
http://www.docbook.org/docs/howto/#d5e810). Second time it was when 
preparing various XHTML + ... schemas for Relaxed validator 
(http://relaxed.cvs.sourceforge.net/relaxed/relaxed/conf/schema/rng/).

Of course, ideally such schemas for compound documents should be created 
using NVDL, but currently NVDL is even less widespread then RELAX NG. 
(BTW, new version of oXygen 8.0 has built in support for NVDL. This 
probably first "commercial" application which offers such support.)

I'm looking forward for your comments,

				Jirka

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
                    Nejbližší termíny školení:
     ** XSLT 23.-26.10.2006 ** XML schémata 13.-15.11.2006 **
      ** DocBook 11.-13.12.2006 ** XSL-FO 11.-12.12.2006 **
------------------------------------------------------------------
   http://xmlguru.cz    Blog mostly about XML for English readers
------------------------------------------------------------------

OpenPGP digital signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]