0

I'm generating java classes from xsd with cxf-xjc-plugin.

<?xml version="1.0" encoding="utf-16"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="result">
 ...
</xsd>

I'm trying to rename the root element using a jaxb-binding.xml file:

<jaxb:bindings    
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    jaxb:extensionBindingPrefixes="xjc"   
    jaxb:version="2.1">

        <jaxb:bindings schemaLocation="xsd/myxsd.xsd" node="//xsd:element[@name='result']">
        <jaxb:class name="MyNewName" />
    </jaxb:bindings>
</jaxb:bindings>

But it does not work. The generated java class is named Result. What might be wrong here?

membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • An xsd:element does not result in a Java class. Class names result from XML Schema types. - Show more of your schema file so it is reproducible, or can be seen what happens. – laune Jul 17 '15 at 09:27
  • 1
    Could you see this my answer at [this link](http://stackoverflow.com/a/29969915/3364187) ? – Xstian Jul 17 '15 at 13:07

0 Answers0