-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible issue with generated DepthFirstSearchTraverserImpl? #6
Comments
See the README for a link to the JAXB tutorial on JAXBElements. In short, there are tweaks to your schema that you can make to avoid JAXBElements. Of course, changing the schema you're working with is not going to work for everybody. There are some tests in place that show how the plugin correctly handles JAXBElements but it seems like you're either working with an older version or have found a bug. I'm happy to accept a pull request. If you don't want to do the patch yourself, you should provide me with a sample schema that illustrates the problem. If your schema is proprietary, try to create a small example in a dummy namespace with just enough of the elements to recreate the problem so I can debug it. |
Well, modifying the schema isn't really practical -- it's from a third party -- and we're using version 2.2 of your tool. The schema is also big. It's imsqti_v2p1.xsd if you're interested. So this appears to be a bug and I'll try to whittle the schema down to a simpler use-case for you. |
I have a simple, stripped use-case for you. Let me know what you find. I'll point out one thing. Here's the XSD. The mixed="true" attribute is <?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="body" type="Body.Type"/>
<xs:element name="p" type="P.Type"/>
<xs:complexType name="Body.Type" mixed="false">
<xs:sequence>
<xs:choice minOccurs = "0" maxOccurs = "unbounded">
<xs:element ref="p" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<!-- The attribute mixed="true" is critical for reproducing the bad behavior. -->
<xs:complexType name="P.Type" mixed="true">
<xs:sequence>
<xs:choice minOccurs = "0" maxOccurs = "unbounded">
<xs:element ref="p" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:schema> |
You can find the use-case project here for a short time. |
I'll be able to look at this today. Thanks for the sample project and small schema. |
Try with the latest snapshot. I'll push to maven central in a few days. |
This looks good. I can remove my patch and my JUnit tests all pass. The generated code, while correct, gives me hundreds of warnings in Eclipse because it's using plain JAXBElement instead of JAXBElement<?>. I sent you a pull request that fixes this. |
Would you please push 2.3 to Maven Central? That's either with or without my pull request. Thanks. |
will look at this today On Thu, Jul 9, 2015 at 10:14 AM, Marc Parmet notifications@github.com
|
done |
The DFS traversal that was generated by your tool gave me a method like this:
and I had to patch it (using a subclass) to get the traverser to visit everything:
The
instanceof JAXBElement
test is the new code. What does your experience suggest why this is necessary? Thanks. Great tool.The text was updated successfully, but these errors were encountered: