OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Validation of missing elements in xml:

[ Lists Home | Date Index | Thread Index ]


I have the simple following xml and dtd:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Person SYSTEM "Person.dtd">


<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT Person (name, email)>
<!ELEMENT email (#PCDATA)>

As per the DTD,  please note that "name"and "email" elements are required 
and if I validate the above with xmlspy
xml is valid and wellformed.

But I want to catch the empty element scenario. for eg, if I remove the 
value of the "name" element from person.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Person SYSTEM "Person.dtd">
	<name></name> -----> see this.

and validate the xml through xmlspy, xml is still valid and wellformed.

How do I catch these empty element problems through DTD? or is it possible 
through xsd? What is that I need to include
in dtd or xsd to validate empty elements in dtd or xsd?

Thanks for your help.

Express yourself instantly with MSN Messenger! Download today - it's FREE! 


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS