Skip Menu |

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

Report information
The Basics
Id: 39691
Status: resolved
Worked: 15 min
Priority: 0/
Queue: XML-Pastor

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

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



Subject: An xs:attributeGroup can't contain an xs:attributeGroup ref
An xs:attributeGroup can't contain an xs:attributeGroup ref: Pastor : Element 'idAttributeGroup' found where unexpected! <attributeGroup name="offerAttributeGroup" > <attributeGroup ref="idAttributeGroup" /> <attribute name="mid" type="mid" use="required" /> </attributeGroup> The workaround is to rewrite the .xsd to in-line the referenced group.
On Mon Sep 29 16:15:09 2008, TIMB wrote: Show quoted text
> An xs:attributeGroup can't contain an xs:attributeGroup ref
In case there's an confusion, a (top-level) xs:attributeGroup can contain an xs:attributeGroup, but it's not supported by Pastor. The fix is very simple. Patch attached.
--- XML/Pastor/Schema/Parser-1.0.3.pm 2009-04-02 14:32:39.000000000 -0400 +++ XML/Pastor/Schema/Parser.pm 2009-04-02 00:27:00.000000000 -0400 @@ -19,6 +19,7 @@ use XML::Pastor::Schema; use XML::Pastor::Util qw(getAttributeHash sprint_xml_element); +BEGIN { *_sprint_xml_element = \&sprint_xml_element; } use Scalar::Util qw(reftype); our @ISA = qw(Class::Accessor); @@ -397,7 +398,8 @@ # Local scope.Add it to the attribute list of the corresponding # ComplexType that is closest to the top of the node stack in # the current context. - if (my $host=$context->findNode(class=>"XML::Pastor::Schema::ComplexType")) { + if (my $host=$context->findNode(class=>["XML::Pastor::Schema::ComplexType", + "XML::Pastor::Schema::AttributeGroup"])) { my $attribs=$host->attributes(); my $attribInfo=$host->attributeInfo(); push @$attribs, $obj->name();
Oops, I included too much in the patch.
--- XML/Pastor/Schema/Parser-1.0.3.pm 2009-04-02 14:32:39.000000000 -0400 +++ XML/Pastor/Schema/Parser.pm 2009-04-02 00:27:00.000000000 -0400 @@ -397,7 +398,8 @@ # Local scope.Add it to the attribute list of the corresponding # ComplexType that is closest to the top of the node stack in # the current context. - if (my $host=$context->findNode(class=>"XML::Pastor::Schema::ComplexType")) { + if (my $host=$context->findNode(class=>["XML::Pastor::Schema::ComplexType", + "XML::Pastor::Schema::AttributeGroup"])) { my $attribs=$host->attributes(); my $attribInfo=$host->attributeInfo(); push @$attribs, $obj->name();
Resolved in the same way proposed by the patch by IEGAMI in the upcoming version (1.0.4). Thanks for the patch IKEGAMI.