Kevin created XMLSCHEMA-56:
------------------------------
Summary: Element defined in a base type sometimes isn't visited by
an XmlSchemaWalker's visitor
Key: XMLSCHEMA-56
URL: https://issues.apache.org/jira/browse/XMLSCHEMA-56
Project: XmlSchema
Issue Type: Bug
Affects Versions: 2.2.4, 2.2.3
Environment: openSUSE Leap 15
open-jdk 11 (but I've tried 1.8 and same thing happens)
xmlschema 2.2.3 and 2.2.4 (core and walker)
Reporter: Kevin
Attachments: walk.tar
Hi,
I have a strange issue where the field in a base type (i.e. one which is
extended by another type) is not visited by the xmlschema-walker. It is strange
because it only happens in some instances of the test project (i.e. when I copy
all project files to a new directory it will sometimes happen in that directory
and sometimes not!). I cannot for the life of me discern a pattern.
This occurs with both 2.2.3 and 2.2.4 of xmlschema (core and walker). I am on
openSUSE Leap 15 and openjdk 11 (but I've tried 1.8 and same thing happens).
Please see my attached tar file. There are two xsd files in the "xsd"
directory. The first is "test.xsd". It defines a type "Test" which extends the
type "Base". The type "Base" has a field "baseElement". The "test.xsd" file
also includes another xsd file "unused.xsd" which is empty, but the behaviour
also occurred when "unused.xsd" defined a used type, I just simplified that
part away for this test. My java file "Main.java" creates an "XmlSchemaWalker"
with a visitor "MyVisitor". "MyVisitor" prints the element name when it visits
an element.
*The bug I'm seeing* is that "baseElement" is not visited by the visitor in
some instances of the project. The root element ("test") is visited. If
"baseElement" is visited when you test the project, please create a few
directories, copy the project files into each, and see if you can reproduce the
error (this is what I mean by "instances" of the project). *NOTE: in each
directory in which you test, you need to change the "xsdDirectory" string at
the start of "testWalker()" in "Main.java"* - the xsd files are in the "xsd"
subdirectory of the project. You'll also need xmlschema-core and
xmlschema-walker jar files on the classpath.
I hope you can reproduce the bug. Please let me know if you need more info.
cheers,
Kevin.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]