This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Default value in XML schema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Default value in XML schema" Watch "Default value in XML schema" New topic
Author

Default value in XML schema

Ashish Soni
Greenhorn

Joined: May 25, 2008
Posts: 24
Hi All ,

I have below xml schema in which i specified a default value for one of the choice , but when i pass a xml without below tags i am not getting the default value , Can some one please help me as how the default value works in XML schema


Thanks,
Ashish Soni
Ashish Soni
Greenhorn

Joined: May 25, 2008
Posts: 24
Please help

Ashish
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

I wouldn't have thought it made any sense to have a default value for an element, since elements don't have values. A default value for an attribute would make sense, but that isn't what you are trying to do there. Actually I am not sure what you are trying to do.
Ashish Soni
Greenhorn

Joined: May 25, 2008
Posts: 24
Thanks a lot , but i am just searching and got to know this from w3schools website and not sure how this works

http://www.w3schools.com/schema/schema_simple.asp




Ashish
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

I would suggest getting a proper learning resource for XML Schema. There are a lot of Internet sites which post reference information about various things but most of them don't have much information beyond that. W3schools is one of those. You can't learn Schema from brief descriptions of its features.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default value in XML schema
 
It's not a secret anymore!