Hi Lynn,

Hard to believe that Xerces isn't reporting this error. When I try your
example with the sax.Counter sample I get:

[Error] label.xml:4:14: Attribute "A1" is required and must be specified
for element type "LABEL".

Validation errors are non-fatal. Are you sure that you're registering an
ErrorHandler and not ignoring the errors reported to it?

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Huynh, Lynn T." <[EMAIL PROTECTED]> wrote on 04/16/2008 10:13:32 AM:

> 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]


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

Reply via email to