aspose file tools*
The moose likes XML and Related Technologies and the fly likes How to validate empty attributes using DTD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to validate empty attributes using DTD" Watch "How to validate empty attributes using DTD" New topic
Author

How to validate empty attributes using DTD

Pavan Tummala
Ranch Hand

Joined: Dec 25, 2004
Posts: 74
Is it possible to not to allow empty attributes (attributes with no vlaues) using DTD validation?
CDATA #REQUIRED on attributes checks if the node it self is present, but not if the value of the attribute is empty.


If Java had true garbage collection, most programs would delete themselves upon execution -- Robert Sewell
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Not according to what I see in section 3.3.2 of the XML Recommendation. I don't see where it allows you to put requirements on the contents of an attribute, other than being a fixed default value.
Pavan Tummala
Ranch Hand

Joined: Dec 25, 2004
Posts: 74
Thanks Paul, you cleared my doubt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to validate empty attributes using DTD