• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to declare in schema that a tag should have value

 
Arun Kumar
Ranch Hand
Posts: 133
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic