users@jaxb.java.net

Re: Importing single .xsd file from JAR project with multiple .xsds

From: Patrick Gallagher <patrick.gallagher_at_cerner.com>
Date: Tue, 15 Jul 2008 11:19:32 -0700 (PDT)

Hi lexi,

When you say "write your own" do you mean writer my own episode file. This
could be done but what would I change in the episode file? I reviewed
http://java.sun.com/xml/ns/jaxb but didn't see a way to describe my
situation to parser.

Thanks,

Patrick



Aleksei Valikov wrote:
>
> Hi.
>
>> I currently have two projects, each producing their own .jar file. In
>> project one, I have two schema files, A.xsd and B.xsd. Each of these are
>> described in an episode file. The episode file is generated by the M2
>> plugin so it is nothing special. In project two I have a schema file
>> A1.xsd
>> that imports A.xsd but not B.xsd. Project2 will not compile correctly
>> because I am not also importing B.xsd. I get the following error.
>>
>> /META-INF/sun-jaxb.episode[11,86]: com.sun.istack.SAXParseException2: SCD
>> "x-schema::tns" didnt match any schema component
>>
>> Is it possible to consume only one of the XSD files from project1 and not
>> the other? If so, is this something that I need to change in project1's
>> episode file or is it something that needs be changed when generating
>> project2? If not, why is this not allowed?
>>
>> I know the workaround is to place each of the XSDs in their own project
>> with
>> their own episode file but this causes a bit of bloat in the number of
>> projects to maintain.
>
> You know, it's not something that isn't allowed explicitly, it's just
> something which grew historically. There was no episodes/separate
> compilation few versions ago, so the solution is quite fresh and may
> not consider all the possible use cases.
>
> Concerning the problem you're describing, I'd say you have two options.
>
> 1. Import both A.xsd and B.xsd. There should be no classes generated
> for B.xsd (well, almost, there are some issues with enums and object
> factory), so why not. If unnecessary classes are generated, just
> delete them with antrun plugin.
>
> 2. Separate A.xsd and B.xsd into two different projects. Yes, this
> does increase the number of modules, but I don't think it's that
> critical especially when you have Maven dependency management.
>
> Further options could be writing your own or processing generated
> episode files. There's quite a number of thing that can be done but
> I'd stay with one of the two options above.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/Importing-single-.xsd-file-from-JAR-project-with-multiple-.xsds-tp18466997p18471757.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.