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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Come On, DTD, Come On! Thoughts on DSDL Part 9

[ Lists Home | Date Index | Thread Index ]


Alternative to extending DTD notation with redundant namespace declarations, one can simply recognize those attribute
declarations which will already need to exist and propagate the imputed constraints among type declarations.

see below and "http://homepage.mac.com/james_anderson/XML/code/xquerydatamodel/qnames.html";

John Cowan wrote:
> 
> ISO/IEC 19757-9 is currently an empty hole titled "Datatype- and
> namespace-aware DTDs".  This is a ragbag of ideas to fill that hole.
> 
> I am assuming that the context for extending DTDs is not redefining
> XML, but rather creating an enhanced XML DTD format which can be used by an
> external validator.  Examples of existing external validators are Jing
> for RELAX NG, XSV for W3C XML Schema, and Sun MSV for many different
> schema formats (including DTDs).  Enhanced DTDs would not be acceptable
> to XML validating parsers.
> 
> I think the following enhancements to standard XML DTDs are worth
> considering.  They are directed to making DTD authoring easier and
> more flexible.  Nothing is introduced that is beyond the current schema
> language state of the art.
> 
> 1) The NS declaration.  Declarations of the form <!NS name SYSTEM "uri">
> are allowed to define the namespaces associated with CNames in ELEMENT
> and ATTLIST declarations.  As is the case for other schema languages, in
> the presence of a known prefix, name matching is done on the universal
> name (URI + local-part) rather than the CName.  The default namespace
> is declared using #DEFAULT in place of the name.
> 
> Example:
> 
> <!NS foo SYSTEM "http://www.example.com/foo";>
> <!NS bar SYSTEM "http://www.example.com/bar";>
> <!ELEMENT foo:a (foo:b)>
> <!ELEMENT bar:a EMPTY>
> 

alternative

? (write-node
 (xmlp:parse-document
  "<!DOCTYPE a [
    <!ELEMENT foo:a (foo:b, bar:a)>
    <!ELEMENT foo:b (bar:a)>
    <!ELEMENT bar:a EMPTY>
    <!ATTLIST foo:a xmlns:foo CDATA 'http://www.example.com/foo' >
    <!ATTLIST bar:a xmlns:bar CDATA 'http://www.example.com/bar' >
    ] >
  <foo:a > <foo:b><bar:a/></foo:b></foo:a>")
 *trace-output* :pretty t :encoding :usascii)
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!DOCTYPE a [
 <!ELEMENT foo:a (foo:b, bar:a) >
 <!ATTLIST foo:a 
   xmlns:foo CDATA  'http://www.example.com/foo' >
 <!ATTLIST foo:a 
    xmlns:bar CDATA 'http://www.example.com/bar' >
 <!ELEMENT foo:b (bar:a) >
 <!ELEMENT bar:a EMPTY >
 <!ATTLIST bar:a 
   xmlns:bar CDATA  'http://www.example.com/bar' >
 ]>

<foo:a xmlns:foo='http://www.example.com/foo'>
  
 <foo:b>
  <bar:a xmlns:bar='http://www.example.com/bar' />
  </foo:b>
 </foo:a>
#<DOC-NODE <no uri> #x98957DE>
? 

...




 

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

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