xml - Generating Java from XSD schemas, two attributes have the same name but different namespaces -


trying generate java code xsd schema complextype contains 2 attributes identical names, different namespaces.

<xsd:complextype name="ct_imagedata">   <xsd:attribute ref="o:href"/>   <xsd:attribute ref="r:href"/> </xsd:complextype> 

xjc says: [error] property "href" defined. use <jaxb:property> resolve conflict.

tried custom bindings:

    <bindings node="//xs:complextype[@name='ct_imagedata']">         <bindings node=".//xs:attribute[@name='href']">             <property name="originalhref"/>         </bindings>     </bindings> 

but binding not selecting attributes: [error] xpath evaluation of ".//xs:attribute[@name='href']" results in empty target node

how target o namespaced href attribute in bindings?

try .//xs:attribute[@ref='o:href'].
it's xpath there's no schema interpretation behind it. make sure xpath points existing node.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -