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

Re: Namespaces and XML validation

  • From: Peter Murray-Rust <peter@u...>
  • To: xml-dev@i...
  • Date: Tue, 11 Aug 1998 06:57:56

xschema java
At 15:13 10/08/98 -0700, Lisa Rein wrote:
>peter murray rust wrote:
>
>> 
>> As I have often
>> (probably boringly) said, I think my community is far more interested in
>> semantic than syntactic validity. (Actually they probably don't care about
>> either much...)
>
>
>How can you possibly have one without the other?  If your syntax is
>bogus -- you won't get far with semantics.  How can you?

I was probably being over-brief in my use of 'syntactic'. I meant that DTDs
only validate the syntactic structure of the document.  Obviously we shall
insist on well-formed XML. Assume I have a content model:

<!ELEMENT Molecule (Atom*, Bond*)>

And a chemist now wishes to include additional information (electron count)
in the molecule, e.g.
<Molecule name="H2+">
	<Electron>1</Electron>
	<Atom>...</Atom>
	<Atom>...</Atom>
	<Bond>...</Bond>
</Molecule>

This breaks the content model. I have the following alternatives:
	- tell the author it's not allowed. Kills the whole idea of XML immediately.
	- produce and circulate a new DTD. Effectively impossible. It would be
redefined so often as to cause chaos.
	- use ANY for all my content models (effectively scrapping content
validation)
	use the DTD for a structural guide but not insist on validation. The DTD
can still be used to help drive authoring tools, support software, etc. So
my software tends to look like:

Molecule.java:

public void process() {
	Vector atomVector = this.getChildrenWithElementName(LOCAL, "Atom");
	Vector bondVector = this.getChildrenWithElementName(LOCAL, "Bond");
}

Note that this allows my to look for what I know to be there while
accepting that other stuff isn't.

For semantic validation I am far more concerned that an atom's atomic
number is between 0 an 100 and is not "-23.7" or "Mickey Mouse".

As you will agree, this is discipline-dependent but I expect to appeal
beyond chemistry.

	HTH

	P.
>
Peter Murray-Rust, Director Virtual School of Molecular Sciences, domestic
net connection
VSMS http://www.nottingham.ac.uk/vsms, Virtual Hyperglossary
http://www.venus.co.uk/vhg

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.