XPATH evaluation results empty target node

1.7k views Asked by At

I have got the following simple XML Schema...

<xs:complexType name="GenericType">
        <xs:annotation>
            <xs:appinfo>ContextBean</xs:appinfo>
            <xs:appinfo>ModifValidac</xs:appinfo>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" name="country" type="TDCs:COUNTRY_Type"/>
            <xs:element minOccurs="0" name="finalDate" type="TDCs:GENERIC_DATE_Type"/>
        </xs:sequence>
    </xs:complexType>

And I'd like to annotate the field "finalDate" with a @jsonIgnore.

<jaxb:bindings version="2.1"
   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"
   xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="annox">

<jaxb:bindings node="xs:complexType[@name='GenericType']/xs:sequence/xs:element[@name='finalDate']">
       <annox:annotate target="field">
             <annox:annotate annox:class="com.fasterxml.jackson.annotation.JsonIgnore"/>
       </annox:annotate>  
</jaxb:bindings>

</jaxb:bindings>

But when i run the command

mvn jaxb2:generate

i get the following error.

XPath evaluation of "xs:complexType[@name='GenericType']/xs:sequence/xs:element[@name='finalDate']" results in empty target node

Can someone help how to achieve this goal without modifying the original XSD?

0

There are 0 answers