Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xml-dev] HowTo describe some things using XML Schema

From: Slava <slava.mayorov@-----.--->
To: xml-dev@-----.---.---
Date: 11/8/2008 9:11:00 AM
hi

im was develop an own format of XML document and want to describe this  
format using XML Schema.

for example i have a ComplexType called "Cloud" with next schema:
======================================================================================
<xsd:complexType name="Cloud">
	<xsd:sequence minOccurs="0" maxOccurs="1">
		<xsd:element name="parentclouds" minOccurs="0" maxOccurs="1">
			<xsd:complexType>
				<xsd:choice minOccurs="0" maxOccurs="unbounded">
					<xsd:element name="cloud" type="CloudObject"/>
				</xsd:choice>
			</xsd:complexType>
		</xsd:element>
		<xsd:group ref="MandatoryAttributes" minOccurs="0" maxOccurs="1"/>
		<xsd:group ref="Attributes" minOccurs="0" maxOccurs="unbounded"/>
	</xsd:sequence>
	<xsd:attribute name="id" type="xsd:NMTOKEN" use="optional"/>
	<xsd:attribute name="name" type="xsd:string" use="required"/>
	<xsd:attribute name="type" type="xsd:string" use="optional"/>
</xsd:complexType>
======================================================================================

1. How to describe a Key which can be declared using @id attribute in any  
elements of "Cloud" type.
2. How to describe a KeyRef which can refers to the @id attribute (to the  
key from first question)
3. How to describe an element which is either a "Cloud" or it can be  
simple element with one attribute called @refid which is a KeyRef from  
second question..

More simple.. how to describe this document:
<cloud id="123" name="newcl"/>
<cloud refid="123"/>
<cloud id="1234" name="test"/>
<cloud id="1234" name="test2"/> <-- an error key not unique
<cloud refid="xxx"/> <-- an error key not declared
<cloud refid="1234" name="test2"/> <-- an error (???), refid is used...

i.e.: when using @refid - the @name and @id attributes must be prohibited  
and vice-versa

TIA

-- 
...with best regards && have a nice day...

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent