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] content model question

[ Lists Home | Date Index | Thread Index ]

From: "Morgan V. Cundiff" <mcundiff@loc.gov>
 
> Thanks for your reply. I was afraid this might be the case. (It is a given
> that our project will use XML Schema and not one of the alternatives.)

The way to solve this kind of problems if you must use XML Schemas is 
to use the <annotation><appinfo> elements. Then you embed a Schematron 
assertion. Appinfo was provided to allow constraints that go beyond XML
Schemas. 
See Eddie Robertsson's article "Combining the power of W3C 
XML Schema and Schematron" at
http://www.topologi.com/public/Schtrn_XSD/Paper.html

To validate, you can make you a script using three XSLT transforms and
open source code (one to extract the constraints, one to compile the constraints,
one to run the constraints) or, if you are on Windows, download the free
Topologi Schematron Validator at http://www.topologi.com/

This kind of content model was available in SGML:
    <!ELEMENT myelement ( #PCDATA, subelement1, subelement2)>
however that kind of content model is not available in XML DTDs or XML Schemas.

One good reason is that usually it means that you have some structure that you want
to elide: that the initial textblob has some significance but you don't want to
tag it. This goes against one thrust in XML, that terseness is not catered for:
if you need terser markup, you need to go away from W3C DBMS approaches more
to the publishing side of the family (ISO, OASIS) of markup standards: RELAX NG,
DSDL, SGML etc.   

Having said that it may be bad modeling, it can undoubtedly be idiomatic markup:
blocking PCDATA from between certain elements may fit in with the way we
like to think about things. And who says terseness is always of minimal importance
anyway?  The XML goal of terseness is primarily about documents being transmitted
over the WWW where other layers are known, not documents being created or maintained
or read.   Two well-known document types which have some kind of data restrictions
are the original TEI and XSLT AFAIK. 

Cheers
Rick Jelliffe





 

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

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