wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes how to declare in schema  that a tag should have value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to declare in schema  that a tag should have value" Watch "how to declare in schema  that a tag should have value" New topic
Author

how to declare in schema that a tag should have value

Arun Kumar
Ranch Hand

Joined: Jan 21, 2005
Posts: 129

How can I declare in the schema that a particular tag should always have value,i.e the tag cannot be empty
Adam Kreiss
Ranch Hand

Joined: Sep 12, 2005
Posts: 35
Well there are a number of ways to do that. If you want the value to come from a specific subset of values, you can specify enumerations:



If your looking for a pattern in the tag that can be defined by a reg-expression, you can use a pattern:



Or probably the easiest way, you can specify a minLength that is greater than 0.

Arun Kumar
Ranch Hand

Joined: Jan 21, 2005
Posts: 129

Thanks Adam Kreiss thank you for your reply I will take the most easiest one by specifying a minLength that is greater than 0

I have fields in xml like the name address etc which cannot be empty ,the enumeration rule and pattern rule cannot be used here because we cant predict the pattern of the value

but by applying the minlength rule I can force that the value should be there

once again thanks Adam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to declare in schema that a tag should have value
 
Similar Threads
HFSP 2nd edition Mock Exam Q69
OpenLDAP - Storing Mutli-Line Attribute Value
Doubts in Mock exam HFSJ
Including special characters in an XML which is validated against a schema
body-content version conflict !!! (***doubt)