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] Invalid XML

[ Lists Home | Date Index | Thread Index ]

Adding to the point that Bob DuCharme made earlier: In XML Schema, it is not illegal to reference or declare (as a local declaration) an element within multiple "content models" (an example of a content model would be your <chapters> element and its subelements and any attributes). One approach within XML Schema would be to declare a global element <name> and reference it in the multiple content models (IMHO, this is the best approach versus re-declaring the element multiple times as a local declaration).
 
If, for some reason, the format of a global element <name> is different within the <subsection> content model than it is within the <chapters> content model (for example, a subsection name may be max 30 characters while a chapter name may be max 20 characters), one would could reference the global element <name> within the <chapters> content model, and declare a local element <name> within the <subsection> content model - or vice versa.
 
Kind Regards,
Joe Chiusano
Booz Allen Hamilton
Strategy and Technology Consultants to the World
 


From: Daniel Zingaro [mailto:daniel_zingaro@cogeco.ca]
Sent: Tuesday, October 19, 2004 3:50 PM
To: xml-dev@lists.xml.org
Subject: [xml-dev] Invalid XML

Hi all,
 
According to the XML specification, I believe the following nesting structure to be invalid in XML. However, rxp on my Windows machine issues no warnings to me when parsed. Is this in fact invalid?
 
 <?xml version="1.1"?>
<library>
<book>
<title>Book Name</title>
<chapters>
<name>first chapter</name>
<name>second</name>
...
<name>last</name>
<subsection>
<name>I expect this to be illegal, since name is defined in chapters,
and also somewhere else in its content, namely subsection.</name>
</subsection>
</chapters>
</book>
</library>
 
Thanks very much,
Dan
 




 

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

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