[Xml-compile] XML::Compile v0.91

Drew Taylor drew at drewtaylor.com
Tue Aug 5 15:07:27 BST 2008


I think I've come across a bug in 0.91 regarding minOccurs. I've tried  
to simplify down things as much as possible w/o removing the possible  
sources of trouble.

The new error message I got is: "error: no match for required block  
`DestinationSubPref' at {http://www.opentravel.org/OTA/ 
2003/05}TTI_ProductSearchRQ/SearchCriteria/DestinationPref". In a  
nutshell, it seems to be getting confused about the "minOccurs"  
attributes. Both the DestinationPref and DestinationSubPref have  
minOccurs=0, so I can't imagine why the SubPref would be required.

My SOAP client looks like:

my $client = XML::Compile::WSDL11->new($xml_file);
# import the various schema files
$client->compileClient(%params);
my ($answer, $trace) = $client->( { body => $params } );

And $params is:
# $VAR1 = {
#   'Version' => 1,
#   'CurrencyCode' => 'EUR',
#   'SearchCriteria' => {
#     'SearchDateRange' => {
#       'Start' => '2009-02-21',
#       'Duration' => 'P7N'
#     },
#     'DestinationPref' => [
#       {
#         'Code' => 'BBVT'
#       }
#     ],
#     'CustomerCounts' => {
#       'CustomerCount' => [
#         {
#           'Code' => 10,
#           'Quantity' => 3
#         }
#       ]
#     }
#   },
#   'POS' => { ... },
# };

A much simplified fragment of the schema is:
	<xs:element name="TTI_ProductSearchRQ">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="POS" type="POS_Type" minOccurs="0"/>
				<xs:element name="SearchCriteria">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="SearchDateRange" minOccurs="0">
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="DateTimeSpanType">
											<xs:attributeGroup ref="DOW_PatternGroup" />
										</xs:extension>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
							<xs:element name="foo1">......</xs:element>
							<xs:element name="DestinationPref" minOccurs="0" maxOccurs="5">
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="DestinationPrefType">
											<xs:sequence>
												<xs:element name="DestinationSubPref"  
type="DestinationPrefType" minOccurs="0" maxOccurs="5"/>
											</xs:sequence>
										</xs:extension>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
							<xs:element name="CustomerCounts" minOccurs="0">
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="CustomerCountsType">
											<xs:attribute name="FreeChildQuantity" type="Numeric1to4"  
use="optional" />
										</xs:extension>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
							<xs:element name="foo2">......</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attributeGroup ref="OTA_PayloadStdAttributes"/>
			<xs:attributeGroup ref="MaxResponsesGroup"/>
			<xs:attributeGroup ref="CurrencyCodeGroup"/>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="DestinationPrefType">
		<xs:attribute name="Code" type="StringLength1to8" use="required"/>
		<xs:attribute name="Name" type="StringLength1to32" use="optional"/>
		<xs:attribute name="Level" type="xs:NMTOKEN" use="optional"/>
		<xs:attributeGroup ref="SearchRelevanceGroup"/>
	</xs:complexType>


On 1 Aug 2008, at 21:36, Mark Overmeer wrote:

>
> At least two weeks worth of fixes/improvements.  Certainly worth
> to upgrade if you start new projects.  Most problems were discovered
> when processing schemas with schemas, for XML::Rewrite.
>
> In short:
>  - Quite some fixes in READER and WRITER around choice with
>    minOccurs=0



More information about the Xml-compile mailing list