Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:20:58+00:00 2026-05-25T16:20:58+00:00

JAXB can’t parse the bindings for this example: <xs:element name=classA type=classA substitutionGroup=classSubA/> <xs:complexType name=complexClassA

  • 0

JAXB can’t parse the bindings for this example:

<xs:element name="classA" type="classA" substitutionGroup="classSubA"/>

<xs:complexType name="complexClassA" mixed="true">

<xs:attribute name="attA">
    <xs:annotation>
        <xs:appinfo>
            <moProperty value="classA:attA"/>
            <label value="Attribute A" default="true"/>
            <externAccess value="readWrite"/>
            <description value="NO COMMENTS"/>
        </xs:appinfo>
    </xs:annotation>
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:enumeration value="off"/>
            <xs:enumeration value="on"/>
        </xs:restriction>
    </xs:simpleType>
</xs:attribute>

And the bindings.xml (fragment):

<jxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
    <jxb:bindings schemaLocation="schema/mySchema.xsd">
        <jxb:bindings node="//xs:complexType[@name='complexClassA']">
            <jxb:bindings node=".//xs:element[@name='attA']">
                <jxb:property name="att" />
            </jxb:bindings>
        </jxb:bindings>
    </jxb:bindings>
</jxb:bindings>

When generating the Java files the error is:

com.sun.istack.SAXParseException2: XPath evaluation of ".//xs:element[@name='attA']" results in empty target node

What I’m overlooking?

Thank you.

Udo.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:20:59+00:00Added an answer on May 25, 2026 at 4:20 pm

    I think this:

    <jxb:bindings node=".//xs:element[@name='attA']">
    

    Should be this:

    <jxb:bindings node=".//xs:attribute[@name='attA']">
    

    You have an attribute, XPath applies to an element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can one ignore Unexpected element situation in JAXB ans still get all other
We have this JAXB annotation: @XmlElement(name = Strategy, required = true) protected List<Strategy> strategy;
I want XML like this: <simple>Foo</simple> I can do this successfully via a JAXB
I tend to use external JAXB bindings files for my Schema-to-Java compilation. This works
How can I get jaxb to bind to my Vector? I cannot seem to
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in
Just curious about how jaxb works, I have a class annotated as follows: @XmlRootElement(name
How can I remove leading/trailing white space before/while marshalling in JAXB?
I am marshalling (serializing) JAXB beans to output stream. How can I add DOCTYPE
How can I get the package name (in general, the class) of a generic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.