Skip Menu |

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

Report information
The Basics
Id: 42176
Status: resolved
Priority: 0/
Queue: XML-Compile

People
Owner: Nobody in particular
Requestors: mindsectr [...] gmail.com
Cc:
AdminCc:

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



Subject: derived by extension of complex types elements processing bug
hi try to create an empty base complex type and derived class with an element, create an element named as base complex type and with type of derived reader fails when trying to process derived class element, but it should process it correctly according to xml schema specification differing attribute declarations and/or content models would apply to elements with the same name in different contexts (here context is defined with datatype) please see test bug_ext_polym.t in attach test fails with: error: element `f_a2' not processed at {http://test-types}f_test/f_a3
Subject: bug_ext_polym.t
#!/usr/bin/perl # test complex type extensions use warnings; use strict; use lib 'lib','t'; use TestTools; use XML::Compile::Schema; use XML::Compile::Tester; use Test::More tests => 3; my $schema = XML::Compile::Schema->new( <<__SCHEMA__ ); <schema targetNamespace="$TestNS" xmlns="$SchemaNS" xmlns:me="$TestNS"> <complexType name="f_t1"> <attribute name="f_a1" type="int"/> </complexType> <complexType name="f_t2"> <complexContent> <extension base="me:f_t1"> <sequence> <element name="f_a2" type="int"/> </sequence> </extension> </complexContent> </complexType> <element name="f_test"> <complexType> <sequence> <element name="f_a3" type="me:f_t1" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element> </schema> __SCHEMA__ ok(defined $schema); test_rw($schema, "f_test" => <<__XML, {f_a2 => 4, f_a1 => 18}); <f_test> <f_a3 type="f_t2" f_a1="18"> <f_a2>4</f_a2> </f_a3> </f_test> __XML
Subject: Re: [rt.cpan.org #42176] derived by extension of complex types elements processing bug
Date: Tue, 6 Jan 2009 13:59:47 +0100
To: avarix via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* avarix via RT (bug-XML-Compile@rt.cpan.org) [090106 12:41]: Show quoted text
> Tue Jan 06 07:41:19 2009: Request 42176 was acted upon. > Transaction: Ticket created by avarix > Queue: XML-Compile > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42176 > > > reader fails when trying to process derived class element, but it should > process it correctly
I do understand your statement and example. Show quoted text
> according to xml schema specification differing attribute declarations > and/or content models would apply to elements with the same name in > different contexts (here context is defined with datatype)
Can you point me to the location in the spec. If this is true, I will have to support it... It is quite much against my attempt to pre-compile the parsing. Probably it should be read 'xsi:type' The nicest way to avoid 'xsi:type' is by using substitutionGroup's -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Втр. Янв. 06 08:00:45 2009, Mark@Overmeer.net писал: Show quoted text
> Can you point me to the location in the spec. If this is true, I will > have to support it... It is quite much against my attempt to pre-compile > the parsing. > > Probably it should be read 'xsi:type' > The nicest way to avoid 'xsi:type' is by using substitutionGroup's
please refer to: http://www.w3.org/TR/xmlschema-1/ 3.3.4 Element Declaration Validation Rules - 4.3 ___ derived types have all attrs and elements of base type, so this feature in xsd allows to create type hierarchies and to use derived type as it would base
Subject: Re: [rt.cpan.org #42176] derived by extension of complex types elements processing bug
Date: Tue, 6 Jan 2009 16:17:41 +0100
To: avarix via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* avarix via RT (bug-XML-Compile@rt.cpan.org) [090106 14:39]: Show quoted text
> Queue: XML-Compile > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42176 > > > Втр. Янв. 06 08:00:45 2009, Mark@Overmeer.net писал: >
> > Can you point me to the location in the spec. If this is true, I will > > have to support it... It is quite much against my attempt to pre-compile > > the parsing. > > > > Probably it should be read 'xsi:type' > > The nicest way to avoid 'xsi:type' is by using substitutionGroup's
> > please refer to: > http://www.w3.org/TR/xmlschema-1/ > 3.3.4 Element Declaration Validation Rules - 4.3
I did see people use it, in rare cases, but never could find it back in the rules... 3.3.4 clause 4.4.3 well... It is considerable work to implement it, but I will have to now. Thanks ;-( -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
xsi:type is supported by release 1.10, which I have just released.