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


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

Re: xjb binding with xs:any

From Sebastian <nowhere@nirvana.org>
Newsgroups comp.lang.java.programmer
Subject Re: xjb binding with xs:any
Date 2016-12-07 23:54 +0100
Organization albasani.net
Message-ID <o2a3vi$lee$1@news.albasani.net> (permalink)
References (1 earlier) <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>

Show all headers | 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