• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I check whether a particular pattern of character is there in the attribute

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have got an xml file and an XSD. I am validating xml file writing all the rules in xsd.
Suppose I want to check whether the character '@' is there in the email attribute of xml file.
with regards
prathibha
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
you can add something like the following restriction in your schema to make sure if it is a valid email address.
<xsd:restriction base="xsd:string">
<xsd:maxLength value="128"/>
<xsd:minLength value="5"/>
<xsd pattern value="^[\w-_\.]*[\w-_\.]\@[\w-]+\.[\w-_\.]+$"/>
</xsd:restriction>
Aamir
[This message has been edited by Aamir Memon (edited July 10, 2001).]
[This message has been edited by Aamir Memon (edited July 10, 2001).]
[This message has been edited by Aamir Memon (edited July 10, 2001).]
 
prathibha, ar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ho,
thanyou very much. Can u please give me the details of this pattern
<xsd attern value="^[\w-_\.]*[\w-_\.]\@[\w-]+\.[\w-_\.]+$"/>
Like what is the correct value according to this pattern.
If I want to replace this email format with a different number
which contains numbers and an hyphen anywhere in the value,
how should i write this
thanks and regards
prathibha
 
reply
    Bookmark Topic Watch Topic
  • New Topic