You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Oliver, Steve" <St...@bestwestern.com> on 2002/10/24 02:27:24 UTC

Problem with attributeGroup

I am using Xerces 1.7.0 and am having a problem using an attributeGroup. When validating this document using other validators, (XML Spy, Microsoft), I have no problem. Using Xerces I get the following error message:

A <attributeGroup> declaration that has a ref attribute, cannot have child content.

Below is a portion of the schema definition and the document that fails validation. I use this attributGroup in many diferent schemas and have no problems with it. Any idea what's going on? 

Thanks,

Steve

	<xs:attributeGroup name="OTA_PayloadStdAttributes">
		<xs:attribute name="EchoToken" type="xs:string"/>
		<xs:attribute name="TimeStamp" type="xs:dateTime"/>
		<xs:attribute name="Target" default="Production">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="Test"/>
					<xs:enumeration value="Production"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="Version" type="xs:string"/>
		<xs:attribute name="SequenceNmbr" type="xs:integer"/>
	</xs:attributeGroup>


	<xs:element name="OTA_HotelInvCountNotifRQ">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="UniqueId" minOccurs="0"/>
				<xs:element ref="HotelReference" minOccurs="0"/>
				<xs:element ref="BaseInvMessages" minOccurs="0"/>
				<xs:element ref="OffSellInvMessages" minOccurs="0"/>
			</xs:sequence>
			<xs:attributeGroup ref="OTA_PayloadStdAttributes">
			</xs:attributeGroup>
		</xs:complexType>
	</xs:element>

<OTA_HotelInvCountNotifRQ EchoToken="V8493847" Version="1" TimeStamp="2002-01-15T15:35:18" Target="Production" xmlns="http://www.opentravel.org/OTA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA OTA_HotelInvCountNotifRQ.xsd">
	<UniqueId Type="POVERALL" Id="_" Instance=""/>
	<HotelReference HotelCode="03049" ChainCode="BW" BrandCode=""/>
	<BaseInvMessages>
		<BaseInvMessage RatePlanClass="PROMO" Inv="50">
			<DateTimeSpan StartInstant="2002-11-15T00:00:00" Duration="P15D"/>
			<DOWPattern Mon="true" Tues="false" Wed="false" Thurs="false" Fri="true" Sat="true" Sun="true"/>
		</BaseInvMessage>
	</BaseInvMessages>
</OTA_HotelInvCountNotifRQ>


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


Re: Problem with attributeGroup

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	have you tried a more recent version of xerces? Stable releases 
are up to 2.1.

Gareth


On Wed, 23 Oct 2002, Oliver, Steve wrote:

> I am using Xerces 1.7.0 and am having a problem using an attributeGroup. When validating this document using other validators, (XML Spy, Microsoft), I have no problem. Using Xerces I get the following error message:
> 
> A <attributeGroup> declaration that has a ref attribute, cannot have child content.
> 
> Below is a portion of the schema definition and the document that fails validation. I use this attributGroup in many diferent schemas and have no problems with it. Any idea what's going on? 
> 
> Thanks,
> 
> Steve
> 
> 	<xs:attributeGroup name="OTA_PayloadStdAttributes">
> 		<xs:attribute name="EchoToken" type="xs:string"/>
> 		<xs:attribute name="TimeStamp" type="xs:dateTime"/>
> 		<xs:attribute name="Target" default="Production">
> 			<xs:simpleType>
> 				<xs:restriction base="xs:NMTOKEN">
> 					<xs:enumeration value="Test"/>
> 					<xs:enumeration value="Production"/>
> 				</xs:restriction>
> 			</xs:simpleType>
> 		</xs:attribute>
> 		<xs:attribute name="Version" type="xs:string"/>
> 		<xs:attribute name="SequenceNmbr" type="xs:integer"/>
> 	</xs:attributeGroup>
> 
> 
> 	<xs:element name="OTA_HotelInvCountNotifRQ">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="UniqueId" minOccurs="0"/>
> 				<xs:element ref="HotelReference" minOccurs="0"/>
> 				<xs:element ref="BaseInvMessages" minOccurs="0"/>
> 				<xs:element ref="OffSellInvMessages" minOccurs="0"/>
> 			</xs:sequence>
> 			<xs:attributeGroup ref="OTA_PayloadStdAttributes">
> 			</xs:attributeGroup>
> 		</xs:complexType>
> 	</xs:element>
> 
> <OTA_HotelInvCountNotifRQ EchoToken="V8493847" Version="1" TimeStamp="2002-01-15T15:35:18" Target="Production" xmlns="http://www.opentravel.org/OTA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA OTA_HotelInvCountNotifRQ.xsd">
> 	<UniqueId Type="POVERALL" Id="_" Instance=""/>
> 	<HotelReference HotelCode="03049" ChainCode="BW" BrandCode=""/>
> 	<BaseInvMessages>
> 		<BaseInvMessage RatePlanClass="PROMO" Inv="50">
> 			<DateTimeSpan StartInstant="2002-11-15T00:00:00" Duration="P15D"/>
> 			<DOWPattern Mon="true" Tues="false" Wed="false" Thurs="false" Fri="true" Sat="true" Sun="true"/>
> 		</BaseInvMessage>
> 	</BaseInvMessages>
> </OTA_HotelInvCountNotifRQ>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



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