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 8911263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:53:55+00:00 2026-06-15T03:53:55+00:00

I am trying to create JAXB binding for xccdf-1.1.4.xsd which is a standard schema

  • 0

I am trying to create JAXB binding for xccdf-1.1.4.xsd which is a standard schema that can be obtain from XCCDF Schema Location

I am currently using EclipseLink MOXy as my JAXB implementation since I like the fact that it can also generate JSON bindings as well.

I fixed couple of occasion where I hit the infamous “[ERROR] Property “value” is already defined” error using an external binding XML, and now I am hitting an error on

[ERROR] Property "Any" is already defined. Use <jaxb:property> to resolve this conflict.
line 441 of file:/home/dchu/Playground/Java/eclipselink_moxy/xccdf_1.1.4/xccdf-1.1.4.xsd

[ERROR] The following location is relevant to the above error
line 444 of file:/home/dchu/Playground/Java/eclipselink_moxy/xccdf_1.1.4/xccdf-1.1.4.xs

Below is a snippet of the line in the XML schema where the error occurred.

<xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="1">
      <xsd:any namespace="http://purl.org/dc/elements/1.1/"
               minOccurs="1" maxOccurs="unbounded"/>
      <xsd:any namespace="http://checklists.nist.gov/sccf/0.1"
               processContents="skip" 
               minOccurs="1" maxOccurs="unbounded"/>
    </xsd:choice>
</xsd:sequence>

Does anyone knows what could be wrong here? Thanks!

  • 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-06-15T03:53:56+00:00Added an answer on June 15, 2026 at 3:53 am

    You can use an external bindings file to rename one of the any properties.

    binding.xml

    <jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
    
        <jxb:bindings schemaLocation="schema.xsd">
            <jxb:bindings
                node="//xsd:complexType[@name='foo']/xsd:sequence/xsd:choice/xsd:any[@namespace='http://checklists.nist.gov/sccf/0.1']">
                <jxb:property name="any2" />
            </jxb:bindings>
        </jxb:bindings>
    
    </jxb:bindings>
    

    XML Schema (schema.xsd)

    Below is a simplified version of your XML schema:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.example.org/schema" 
        xmlns="http://www.example.org/schema"
        elementFormDefault="qualified">
    
        <xsd:complexType name="foo">
            <xsd:sequence>
                <xsd:choice minOccurs="1" maxOccurs="1">
                    <xsd:any namespace=""
                        minOccurs="1" maxOccurs="unbounded" />
                    <xsd:any namespace="http://checklists.nist.gov/sccf/0.1"
                        processContents="skip" minOccurs="1" maxOccurs="unbounded" />
                </xsd:choice>
            </xsd:sequence>
        </xsd:complexType>
    
    </xsd:schema>
    

    XJC Call

    Below is how you make an XJC call that leverages an external binding file.

    xjc -b binding.xml schema.xsd
    

    Generated Class (Foo)

    package org.example.schema;
    
    import java.util.*;
    import javax.xml.bind.annotation.*;
    import org.w3c.dom.Element;
    
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "foo", propOrder = {
        "any",
        "any2"
    })
    public class Foo {
    
        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyElement
        protected List<Element> any2;
    
    
        public List<Object> getAny() {
            if (any == null) {
                any = new ArrayList<Object>();
            }
            return this.any;
        }
    
        public List<Element> getAny2() {
            if (any2 == null) {
                any2 = new ArrayList<Element>();
            }
            return this.any2;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying create system in which I can login from php and then
i'm trying to generate classes that i can use from the validator xsd files
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a macro which can be used for print debug messages when
I'm trying create a ASMX webservice that can perform a HTTP GET request. I
I am trying to create java objects from xml file. I am using jaxb(unmarshalling)
I'm trying create an intermediate object to work with elsewhere that I can pass
I'm currently trying create a service that will return results of a OLAP cube
I am trying to create objects using binding data from xml file to classes
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM

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.