• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

validation.xml-problem including "&" in one of the constants

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I modify my constant in validation.xml(for validator framework) so that it allows a user to include & along with alphabets , single apostrophe(which is already in there)?
<constant>
<constant-name>somename</constant-name>
<constant-value>^([a-zA-Z]|'|)*$</constant-value>
</constant>
At this point it just lets me add alphabets(be it small or capital) and have a single apostrophe .
This is done so as to allow names like
AB
Macy's
I am facing problem when i try to include &(special character) so as to allow names like
A&B



Thanks
 
Sheriff
Posts: 28411
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want an "&" character in an XML text node, you have to escape it as "&amp;". Or you can make the entire text node a CDATA node. This tutorial page gives examples of both techniques.
[ May 04, 2006: Message edited by: Paul Clapham ]
 
cj jaswal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks... will go through the link and try it out.
 
cj jaswal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul..... "&" worked for the valiation.xml
 
cj jaswal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
er......meant &
 
cj jaswal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"&"
 
cj jaswal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i give up ...............it's ampersand which worked( getting it to show up on the post is as difficult as trying out modifying my validation.xml if not more)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic