This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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 Introducing JavaFX 8 Programming this week in the JavaFX 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
Sheriff

Joined: Oct 14, 2005
Posts: 19739
    
  10

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
 
It's not a secret anymore!