Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Get exactly one choice element

From: mario.eugster@---------.--- (-----)
To: NULL
Date: 12/1/2004 2:12:00 AM
Hi;

I try to limit the selection of elements to exactly one. I have to do
it by using elements, attributes are no alternativ.
If I use the configuration shown below, it is also possible to select
no element. If I set minOccurs to 1 at both elements, I have to select
both. How I can can define that just one and no more than one element
are allowed?

Thx for your help!


If I have the following xsd:
----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="test">
		<xs:complexType>
			<xs:choice>
				<xs:element name="element1" minOccurs="0"/>
				<xs:element name="element2" minOccurs="0"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
</xs:schema>

and the following xml should not be allowed:
-----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schematest.xsd">
</test>


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