IntelliJ Java IDE
The moose likes XML and Related Technologies and the fly likes Can I check whether a particular element has some pattern only if it is not null Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Can I check whether a particular element has some pattern only if it is not null" Watch "Can I check whether a particular element has some pattern only if it is not null" New topic
Author

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

prathibha, ar
Greenhorn

Joined: Jun 22, 2001
Posts: 13
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
Aamir Memon
Greenhorn

Joined: Jul 05, 2001
Posts: 7

You can do that as follows
<xsd:element name="Date" nullable="true" type="xsd:date">
Aamir
prathibha, ar
Greenhorn

Joined: Jun 22, 2001
Posts: 13
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
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Hi there,
I think you need something like:
<xsd:element name="Date" type="xsd:date" nillable = "true" />
Hope it works.
Ambrose Tati
 
IntelliJ Java IDE
 
subject: Can I check whether a particular element has some pattern only if it is not null
 
Threads others viewed
How to search a pattern in a large file using java
Can I check whether a particular pattern of character is there in the attribute
Websphere Security for v5.1
java.util.Properties loadXMLFile()
unable to run sample application in Struts2
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com