Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36067

Re: xjb binding with xs:any

Path csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From Sebastian <nowhere@nirvana.org>
Newsgroups comp.lang.java.programmer
Subject Re: xjb binding with xs:any
Date Wed, 7 Dec 2016 23:54:42 +0100
Organization albasani.net
Lines 71
Message-ID <o2a3vi$lee$1@news.albasani.net> (permalink)
References <71be9001-1988-401b-b04b-2b5e668e8622@googlegroups.com> <o1n4sr$i2n$1@news.albasani.net> <f81a5812-70f9-433c-a4d3-9770d7f04afc@googlegroups.com> <dac441ef-d06a-40ae-b6b4-1858a3df8030@googlegroups.com> <d57e28a4-33f3-4361-9700-f75a70c478f8@googlegroups.com> <o2a3ke$nci$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net 4g92tgJZIVd7DHG78MFvt8GtQ61r/4LYuEaEjuYt6ykZkwI8Wk/HSL+rvKpD+ew9ofiZDsI1JNfzeg0il8xHSw==
NNTP-Posting-Date Wed, 7 Dec 2016 22:54:42 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="4gY25tXkXZvWYDAXYnimrZt8lf61VXrlfbqJEVp8kej/k8OyNArN+CLO/D5h+hCMboi/vPgndIx4tRnM6spOEbhlj/P5AZPBJ+oRD2bVJxFXdR7z+HfTOcv3cuHBqfUZ"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
In-Reply-To <o2a3ke$nci$1@news.albasani.net>
Cancel-Lock sha1:QfzMPU+ILgLz1Xh5uGS9DWJLJvQ=
Xref csiph.com comp.lang.java.programmer:36067

Show key headers only | View raw


Am 07.12.2016 um 23:48 schrieb Sebastian:
> Am 07.12.2016 um 12:28 schrieb Philipp Kraus:
>> Am Freitag, 2. Dezember 2016 13:30:10 UTC+1 schrieb Philipp Kraus:
>>> Am Mittwoch, 30. November 2016 22:05:02 UTC+1 schrieb Philipp Kraus:
>>>> Thanks I will take a look, but the question is still unanswerd :-)
>>>
>>> Some additional comments, the problems seems to be on the included
>>> schema, which is XSD 1.1 and Jaxb does not support the 1.1
>>> definition, it supports XSD 1.0 only.
>>>
>>> Therese seems to be a component https://xsom.java.net/ which should
>>> support 1.1, but not the xs:override, so the main question is how can
>>> I use the 1.1 schema without modifying the included schema.
>>
>>
>> We can solve the problem with the binding file:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <jaxb:bindings version = "2.1"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:jaxb = "http://java.sun.com/xml/ns/jaxb"
>>>
>>     <jaxb:bindings schemaLocation="network.xsd">
>>                <jaxb:globalBindings generateIsSetMethod="false"/>
>>         <jaxb:schemaBindings>
>>                  <jaxb:package
>> name="com.github.aptd.simulation.model.xml"/>
>>               </jaxb:schemaBindings>
>>     </jaxb:bindings>
>>     <jaxb:bindings
>> schemaLocation="http://www.railml.org/files/download/schemas/2016/railML-2.3/schema/infrastructure.xsd">
>>
>>                 <jaxb:bindings
>> node="//xs:schema/xs:complexType[@name='eTrack']/xs:complexContent/xs:extension/xs:sequence/xs:any[@namespace='##other']">
>>
>>                            <jaxb:property name="any2"/>
>>                 </jaxb:bindings>
>>     </jaxb:bindings>
>>     <jaxb:bindings
>> schemaLocation="http://www.railml.org/files/download/schemas/2016/railML-2.3/schema/genericRailML.xsd">
>>
>>                    <jaxb:bindings
>> node="//xs:schema/xs:complexType[@name='tElementWithIDAndName']/xs:sequence/xs:any[@namespace='##other']">
>>
>>                            <jaxb:property name="any3"/>
>>                    </jaxb:bindings>
>>     </jaxb:bindings>
>>     <jaxb:bindings
>> schemaLocation="http://www.railml.org/files/download/schemas/2016/railML-2.3/schema/timetable.xsd">
>>
>>                    <jaxb:bindings
>> node="//xs:schema/xs:complexType[@name='eTrainPart']/xs:complexContent/xs:extension/xs:sequence/xs:any[@namespace='##other']">
>>
>>                            <jaxb:property name="any4"/>
>>                    </jaxb:bindings>
>>     </jaxb:bindings>
>> </jaxb:bindings>
>>
>
> Thanks for sharing this. By renaming some of the any's you will indeed
> get rid of compiler complaints about multiple definitions. But does this
> also help with getting the desired wildcard binding mode
> (processContents="skip")? I suppose it will not, but I myself am unable
> to come up with anything better.
>
> -- Sebastian

To pose the question another way: Is it still a wildcard after renaming? 
If not, won't you get validation problems with some XML files?

-- Sebastian

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

xjb binding with xs:any Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-11-29 11:07 -0800
  Re: xjb binding with xs:any Sebastian <nowhere@nirvana.org> - 2016-11-30 19:13 +0100
    Re: xjb binding with xs:any Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-11-30 13:04 -0800
      Re: xjb binding with xs:any Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-12-02 04:30 -0800
        Re: xjb binding with xs:any Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-12-07 03:28 -0800
          Re: xjb binding with xs:any Sebastian <nowhere@nirvana.org> - 2016-12-07 23:48 +0100
            Re: xjb binding with xs:any Sebastian <nowhere@nirvana.org> - 2016-12-07 23:54 +0100

csiph-web