-
Notifications
You must be signed in to change notification settings - Fork 99
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
addressing #41 #55
addressing #41 #55
Conversation
Impressive, thank you. |
You're welcome. |
Hi, that's great! Maybe we should name differently the option. But the first part, which is generating episode files with the if-exists attributes, is not about allowing anything. I don't know how to name it… |
Got it. How about allowImporWithUnusedSchemaBindingsInEpisode? Maybe it's a little too big...couldn't think of anything shorter. |
Or we name it after the hack and not the objective, something like: applyEpisodeHackForUnusedSchemaBindings. Also, do you think it would be hard to implement the complementary solution as part of this pull request? The idea would be to have the xsl applied to episodes while they are read, I think @highsource said in #41 that there was a way to introduce a resource resolver to do so. |
I think we'll really have to rework this with resolvers. |
…sedSchemaBindings
Renamed the property as you suggested. @highsource, when you mention "rework this with resolvers" you mean adding XSLT transformation somewhere in MavenCatalogResolver? |
Yep. The proposed solution transforms the generated episode file. Which is OK and good but does not help with existing episodes. As for the episode generation I'd really think about fixing the XJC's episode plugin. |
Ok, so maybe as a first step, it would be better to fix reading of episodes (instead of generation) by using an entity resolver. As for the generation, it is actually not so important if we have the reading that works. |
About fix reading of episodes, I couldn't find anything about episode's entity resolvers, nor I could think of a way to apply the XSLT transformation right before the episode file is parsed. @highsource , If you have a clear idea of how that could be acchieved maybe I can help. I agree about fixing XJC's episode plugin to properly resolve the episode generation, this would definitely work for me, since in my case I'm not worried about existing episodes. As for now, I'll be using the hacked version of XSLT approach on generation until we find a proper solution. |
I've thought about it, here's what I think. The correct place to apply this fix would be the episode plugin in XJC: I'd add a "-episode-bindings-if-exists" option and consider it during the generation. This is where this fix actually belongs. @andreptb could you please consider sending a fix to the JAXB people as PR? The problem is, however, that JAXB people don't really seem to be active in applying PRs. So not sure if they'd really do this. Therefore I think having this workaround in The implementation is OK. My suggestions would be:
@andreptb Would this be something you could overtake? Now, about applying XSLT on read. This is a nice option, but seems quite complicated to me at the moment. I think, we'll solve, like the 80% case with just generating Thank you guys for your contributions! |
@highsource,
I've implemented @victornoel XSLT approach, configurable with allowUnusedSchemaBindingsInEpisodes property. This worked for me, hopefully will help you resolve #41.