|
|
|
|
|
|
Re: XSD to Java code generation with multiple import of the same namespace [message #425725 is a reply to message #425710] |
Fri, 05 December 2008 15:36 |
Eclipse User |
|
|
|
Originally posted by: blazej.kroll.gmail.com
Hello,
Thank you for the answer Ed.
Just to close the subject. Can I expect the multiple import to work in
EMF 2.2 or 2.3? Or is it a new introduced thing?
Regards,
Blazej
Ed Merks pisze:
> Blazej,
>
> Comments below.
>
>
> Blazej Kroll wrote:
>> Hello, to clarify the issue I'm facing:
>>
>> I want to generate Java from XML Schema.
>> I am facing a validation error from Xerces when using multiple imports
>> in an xml schema file like:
>> <xsd:import schemaLocation="Part1.xsd"
>> namespace="http://TestLibB"></xsd:import>
>> <xsd:import schemaLocation="Part2.xsd"
>> namespace="http://TestLibB"></xsd:import>
> It seems to me they ought to support that.
>>
>> After looking for a workaround I tried to make it another way (not to
>> see the validator's error)
>> and make a fsingle file which includes the necessary Part1.xsd and
>> Part2.xsd files and then import that file in the main Schema from
>> which I will generate the Java code.
>>
>> Some file which gatheres all the necessery ones called
>> Intermediate.xsd which includes:
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> targetNamespace="http://TestLib/B">
>> <xsd:include schemaLocation="Part1.xsd"></xsd:include>
>> <xsd:include schemaLocation="Part2.xsd"></xsd:include>
>> </xsd:schema>
>>
>> and then in the main file to generate Java code I use single import
>> operation:
>> <xsd:import namespace="http://TestLib/B"
>> schemaLocation="Intermediate.xsd"></xsd:import>
>>
>> So the validator is giving no errors.
> Yes, that should work.
>> Just to summer things up I want to make sure that from the EMF side
>> both these scenarioes (multiple import usage) generate a valid Java
>> code despite the validator's error in the first case.
> Yes, EMF should treat them as entirely equivalent and should generate
> the same code for each.
>>
>> Regards,
>> Blazej
>>
|
|
|
Re: XSD to Java code generation with multiple import of the same namespace [message #425730 is a reply to message #425725] |
Fri, 05 December 2008 16:04 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Błażej,
It's always worked.
Błażej Kroll wrote:
> Hello,
>
> Thank you for the answer Ed.
>
> Just to close the subject. Can I expect the multiple import to work in
> EMF 2.2 or 2.3? Or is it a new introduced thing?
>
> Regards,
> Blazej
>
>
> Ed Merks pisze:
>> Blazej,
>>
>> Comments below.
>>
>>
>> Blazej Kroll wrote:
>>> Hello, to clarify the issue I'm facing:
>>>
>>> I want to generate Java from XML Schema.
>>> I am facing a validation error from Xerces when using multiple
>>> imports in an xml schema file like:
>>> <xsd:import schemaLocation="Part1.xsd"
>>> namespace="http://TestLibB"></xsd:import>
>>> <xsd:import schemaLocation="Part2.xsd"
>>> namespace="http://TestLibB"></xsd:import>
>> It seems to me they ought to support that.
>>>
>>> After looking for a workaround I tried to make it another way (not
>>> to see the validator's error)
>>> and make a fsingle file which includes the necessary Part1.xsd and
>>> Part2.xsd files and then import that file in the main Schema from
>>> which I will generate the Java code.
>>>
>>> Some file which gatheres all the necessery ones called
>>> Intermediate.xsd which includes:
>>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> targetNamespace="http://TestLib/B">
>>> <xsd:include schemaLocation="Part1.xsd"></xsd:include>
>>> <xsd:include schemaLocation="Part2.xsd"></xsd:include>
>>> </xsd:schema>
>>>
>>> and then in the main file to generate Java code I use single import
>>> operation:
>>> <xsd:import namespace="http://TestLib/B"
>>> schemaLocation="Intermediate.xsd"></xsd:import>
>>>
>>> So the validator is giving no errors.
>> Yes, that should work.
>>> Just to summer things up I want to make sure that from the EMF side
>>> both these scenarioes (multiple import usage) generate a valid Java
>>> code despite the validator's error in the first case.
>> Yes, EMF should treat them as entirely equivalent and should generate
>> the same code for each.
>>>
>>> Regards,
>>> Blazej
>>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04107 seconds