Skip Menu |

This queue is for tickets about the XML-Pastor CPAN distribution.

Report information
The Basics
Id: 44761
Status: resolved
Priority: 0/
Queue: XML-Pastor

People
Owner: aulusoy [...] cpan.org
Requestors: IKEGAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: A complexType fails to extend a simpleType
Pastor dies when it encounters a complexType that extends a simpleType, as in the following example: <xs:complexType name="CountryNameType"> <xs:annotation> <xs:documentation xml:lang="en">The name or code of a country (e.g. as used in an address or to specify citizenship of a traveller).</xs:documentation> </xs:annotation> <xs:simpleContent> <xs:extension base="StringLength0to64"> <xs:attribute name="Code" type="ISO3166" use="optional"> <xs:annotation> <xs:documentation xml:lang="en">ISO 3166 code for a country.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:simpleType name="StringLength0to64"> <xs:annotation> <xs:documentation xml:lang="en">Used for Character Strings, length 0 to 64</xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> <xs:minLength value="0"/> <xs:maxLength value="64"/> </xs:restriction> </xs:simpleType> Patch attached.
Subject: complexType_from_simpleType.patch
--- XML/Pastor/Schema/Model-1.0.3.pm 2009-04-02 14:32:30.000000000 -0400 +++ XML/Pastor/Schema/Model.pm 2009-04-02 14:57:54.000000000 -0400 @@ -458,8 +458,10 @@ my $xattribs = []; my $xattribInfo = {}; - push @$xattribs, @{$baseType->effectiveAttributes()}; - mergeHash ($xattribInfo, $baseType->effectiveAttributeInfo()); + if (UNIVERSAL::can($baseType, "effectiveAttributes")) { + push @$xattribs, @{$baseType->effectiveAttributes()}; + mergeHash ($xattribInfo, $baseType->effectiveAttributeInfo()); + } push @$xattribs, @{$object->attributes()}; mergeHash ($xattribInfo, $object->attributeInfo()); @@ -476,8 +478,10 @@ my $xelems = []; my $xelemInfo = {}; - push @$xelems, @{$baseType->effectiveElements()}; - mergeHash ($xelemInfo, $baseType->effectiveElementInfo()); + if (UNIVERSAL::can($baseType, "effectiveElements")) { + push @$xelems, @{$baseType->effectiveElements()}; + mergeHash ($xelemInfo, $baseType->effectiveElementInfo()); + } push @$xelems, @{$object->elements()}; mergeHash ($xelemInfo, $object->elementInfo());
Fixed in upcoming version 1.0.4 as suggested by the patch by IKEGAMI. Thanks IKEGAMI!