Issue 156 in genxdm: Schema parser calculates incorrect type for element declaration

8 views
Skip to first unread message

gen...@googlecode.com

unread,
Nov 3, 2014, 1:08:51 PM11/3/14
to gen...@googlegroups.com
Status: New
Owner: joe.bays...@gmail.com
Labels: Type-Defect Priority-Medium Milestone-Release1.1
Component-Processors

New issue 156 by joe.bays...@gmail.com: Schema parser calculates incorrect
type for element declaration
https://code.google.com/p/genxdm/issues/detail?id=156

When an element declaration lacks a "type" attribute but does have
a "substitutionGroup" attribute, the type of the element should be the type
of the element named in the substitution group.

For example:

<xs:element name="foo" substitutionGroup="ns1:bar"/>

The type of the foo element should be the same as the type of ns1:bar
element. (See section 3.3.2 of the schema spec.)


Currently the schema parser is raising an
org.genxdm.processor.w3c.xs.exception.scc.SccElementDeclarationSubstitutionGroupTypeDerivationException.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gen...@googlecode.com

unread,
Nov 10, 2014, 11:12:52 AM11/10/14
to gen...@googlegroups.com

Comment #1 on issue 156 by joe.bays...@gmail.com: Schema parser calculates
incorrect type for element declaration
https://code.google.com/p/genxdm/issues/detail?id=156

The element type was set incorrectly for the following two use cases:
1. The declaration for element A lacks a type attribute and is in subgroup
of element b; the declaration for element b also lacks a type attribute and
is in subgroup of c; the element declaration for element c does have a type
attribute. In this case elements a and b should have the same type as
element c; instead, they are set to xs:anyType.
2. The declaration for element A lacks a type attribute and is in the
subgroup of element b; element b is from an imported document and that
document has already been parsed, placing element b in the
SchemaComponentCache for already parsed documents. Element A's type is
improperly set to xs:anyType.

gen...@googlecode.com

unread,
Nov 10, 2014, 11:19:14 AM11/10/14
to gen...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 156 by joe.bays...@gmail.com: Schema parser calculates
incorrect type for element declaration
https://code.google.com/p/genxdm/issues/detail?id=156

(r519)
To address use case #1 from previous comment, we modified the
XMLSchemaCache.computeSubstitutionGroup method to be recursive, so that
elements w/o typeRefs but w/substitution groups can have their type
properly set.

To address use case #2, we modified the XMLSchemaConverter.convertElement
method. Now, if an element's typeRef is the complexUrType (indicating the
lack of a type attribute in the element declaration) and the element is a
member of a substitutionGroup, we use the substitutionGroupHead's type as
the element type.
Reply all
Reply to author
Forward
0 new messages