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

  • Home
  • SEARCH
  • 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 8827273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:20:01+00:00 2026-06-14T07:20:01+00:00

Does it mean the XML element is mandatory ? Or the XML element must

  • 0

Does it mean the XML element is mandatory ? Or the XML element must have some non-null value ? I am really confused by the javadoc explanation.

  • 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-14T07:20:02+00:00Added an answer on June 14, 2026 at 7:20 am
    @XMLElement(required=true)
    

    generates something like this in the XML schema:

    <xs:element name="city" type="xs:string" minOccurs="1"/>
    

    which means the element and a value are mandatory. The default is false.

    This:

    @XMLELement(nillable=true)
    

    generates something like this in the XML schema:

    <xs:element name="city" type="xs:string" nillable="true"/>
    

    which means you can pass in a nil value in your XML like this:

    <city xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    

    Combining the two like this:

    @XMLELement(nillable=true, required=true)
    

    gives an XML schema definition similar to this:

    <xs:element name="city" type="xs:string" nillable="true"/>
    

    which means the element is mandatory but you can pass in a nil value.

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

Sidebar

Related Questions

Is empty a valid value for XML namespace? If yes what does it mean?
I have XML data which contains a long attribute value. The value does not
What does this mean: Next add reference to: MySql.Data actually I have downloaded mysql
What does multiplexing mean (in it's abstract form)? I understand you have 'multiplexers' in
I have a class which reads some settings from an XML file with simplexml.
Please explain in naive terms. What does it actually mean by XML Validation? Do
I have an xml and it has nodes with i:nil=true in it. What does
I have an XML schema, where element Calling1 is defined like this: <xsd:element name=Calling1
If an oembed provider is only outputting json and xml, does that mean it
Getting the error below from Eclipse. What does it mean must be well-formed ?

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.