[
https://issues.apache.org/jira/browse/XMLSCHEMA-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15641784#comment-15641784
]
Andreas Veithen commented on XMLSCHEMA-42:
------------------------------------------
I'm not an XML schema expert, but in the specifications I see this:
bq. {type definition} The simple type definition corresponding to the
<simpleType> element information item in the \[children\], if present,
otherwise the simple type definition ·resolved· to by the ·actual value· of the
type \[attribute\], if present, otherwise the ·simple ur-type definition·.
(Part 1, Section 3.2.2)
bq. A distinguished complex type definition, the ur-type definition, whose name
is anyType in the XML Schema namespace, is present in each ·XML Schema·,
serving as the root of the type definition hierarchy for that schema. (Part 2,
Section 2.2.1.1)
Doesn't this mean that we should default to xs:anyType instead of using a null
type?
> xmlschema-walker fails when an xs:attribute has no type attribute
> -----------------------------------------------------------------
>
> Key: XMLSCHEMA-42
> URL: https://issues.apache.org/jira/browse/XMLSCHEMA-42
> Project: XmlSchema
> Issue Type: Bug
> Affects Versions: 2.2.1
> Reporter: Tobias Crawley
> Attachments: XMLSCHEMA-42-with-test.patch
>
>
> When using xmlschema-walker against an XSD that has an attribute definition
> that lacks a type, I get the following NPE:
> {noformat}
> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.getAttribute(XmlSchemaScope.java:569)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.createAttributeMap(XmlSchemaScope.java:629)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:310)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:151)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.<init>(XmlSchemaScope.java:91)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.getScope(XmlSchemaScope.java:696)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:333)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:306)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:151)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaScope.<init>(XmlSchemaScope.java:112)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:224)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:339)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:486)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:336)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:295)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:339)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:486)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:336)
> at
> org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:295)
> {noformat}
> The XSD that triggered this was
> https://github.com/wildfly/wildfly-core/blob/master/server/src/main/resources/schema/wildfly-config_4_2.xsd#L2774
> (that line specifically).
> I have a patch to fix this that I'll attach shortly. It doesn't include any
> tests, because most of the tests fail for me with a fresh checkout, so it's
> hard to confirm that any tests I write are working. I have tested the fix
> manually.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]