Hi,
In my DTD, I have one of the attribute name as a required attribute.
However,  when I used it and do not have it in the xml, Xerces does not
return any error.  
I have factory.setValidating(true) and
xmlReader.setFeature("http://xml.org/sax/features/validation";, true).
 
Here is the sample DTD:
<!ELEMENT LABEL ANY>
<!ATTLIST LABEL A1 CDATA #REQUIRED>
<!ATTLIST LABEL A3 CDATA "">
<!ENTITY title "The title">
<!ELEMENT FIRST (#PCDATA)>
<!ATTLIST FIRST A2 CDATA "">
<!ENTITY subtitle "my subtitle">
<!ELEMENT SECOND (#PCDATA)>
<!ELEMENT THIRD (#PCDATA)>
 
Sample XML, please note LABEL does not have the required A1 attribute:
<!DOCTYPE LABEL SYSTEM "label.dtd">
<!-- This is a comment -->                     
<?xml-stylesheet type="text/xml"?>           
<LABEL A3="">                
  $3.99                                        
  <!-- This is another comment -->             
  <![CDATA[ << CDATA >> ]]>                    
  &title;                                      
  <FIRST A2="Or &subtitle;"/>                    
  <SECOND/>                                       
</LABEL>
 
Thanks in advance for any input.
Lynn


 

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to