You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Srividhya (JIRA)" <xe...@xml.apache.org> on 2014/07/15 16:54:05 UTC

[jira] [Created] (XERCESJ-1639) Adding assertions in an abstract complex type

Srividhya created XERCESJ-1639:
----------------------------------

             Summary: Adding assertions in an abstract complex type
                 Key: XERCESJ-1639
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1639
             Project: Xerces2-J
          Issue Type: Bug
            Reporter: Srividhya


I am using the XSD 1.1 and trying to add assertions to the complex types.
I have an abstract complex type and another concrete complex type extending the abstract complex type.

For example:

<xs:complexType name="abstract-comp-type" abstract="true">
		<xs:sequence>
			<xs:element type="xs:string" name="description" minOccurs="1" maxOccurs="1" />
			<xs:element name="comp-id" type="xs:ID" minOccurs="1" />
	</xs:complexType>
	
	<xs:complexType name="concrete-comp-type">
		
		<xs:complexContent>
			<xs:extension base="abstract-comp-type">
				<xs:sequence>
					<xs:element name="element1" type="xs:string" minOccurs="1" fixed="test"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

If I have more than one complex types extending from abstract-comp-type, how do I add validation to check if all the sub types have an element named element1?
The reason why I need to add element1 in the sub type is to provide a fixed value. I cannot use restriction because the sub type will have more elements than the abstract type.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org