• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Can I check whether a particular element has some pattern only if it is not null

 
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 an xml file and i am validating this xml file by means of xsd.
I have an attribute called date which can be null also. but if suppose it is not null then i want to check for the pattern for it.
Is it is possible.
Thanks and 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

You can do that as follows
<xsd:element name="Date" nullable="true" type="xsd:date">
Aamir
 
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
Thankyou for the reply.
I tried the think which u had told . but it is giving the error
as
Attribute 'nullable' cannot appear in 'element'.
What may be the reason for this.
prathibha
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I think you need something like:
<xsd:element name="Date" type="xsd:date" nillable = "true" />
Hope it works.
Ambrose Tati
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic