[xml] validation discrepency



Hi,
 
I have been working with the libxml coding examples, parser2.c and reader2.c and I am seeing a discrepency in the DTD validations. I have an XML file and corresponding DTD that are validated by xmllint and the parser2 test program but not validated by reader2.
What is the difference between
The calls to xmlCtxtReadFile like so
 
doc = xmlCtxtReadFile(ctxt, filename, NULL, XML_PARSE_DTDVALID);
 
in parser2 and the call to xmlReaderForFile
 
reader = xmlReaderForFile(filename, NULL,
                 XML_PARSE_DTDATTR |  /* default DTD attributes */
XML_PARSE_NOENT |    /* substitute entities */
XML_PARSE_DTDVALID); /* validate with the DTD */
 
in reader2? Where is the error?
 
For what it is worth I am attaching the xml and DTD.
 
Thanks
 
Ted


Do you Yahoo!?
Free Pop-Up Blocker - Get it now
<?xml version="1.0" encoding="UTF-8"?>                                          
<!DOCTYPE MESSAGE SYSTEM "message.dtd">                                         
<MESSAGE>                                                                       
<TRANS_ID>12234</TRANS_ID>                                                      
<TYPE>EMAIL</TYPE>                                                              
<DATE>20031107</DATE>                                                           
<TIME>160505</TIME>                                                             
<SENDER>                                                                        
      <ADDRESS URI="smtp:john comverse com"/>                                   
</SENDER>                                                                       
<RECIPIENT>                                                                     
      <ADDRESS URI="smtp:ali yahoo com"/>                                       
      <ADDRESS URI="smtp:lisa celcome com"/>                                    
</RECIPIENT>                                                                    
<LANGUAGE>en</LANGUAGE>                                                         
<TEMP_ID>conference_call_email.xsl</TEMP_ID>                                    
<CONTENT>You have been invited to a conference by John. The Conference Room is 1
23455 on November 7, 2003 at 3 PM. Dial 1-800-JOIN-CALL and enter 456788 as the 
pass code.</CONTENT>                                                            
</MESSAGE>
<?xml version="1.0" encoding="UTF-8"?>                                          
<!ELEMENT MESSAGE (TRANS_ID,                                                    
                TYPE,                                                           
                DATE,                                                           
                TIME,                                                           
                SENDER,                                                         
                RECIPIENT,                                                      
                LANGUAGE,                                                       
                TEMP_ID,                                                        
                CONTENT)>                                                       
<!ELEMENT TRANS_ID (#PCDATA)>                                                   
<!ELEMENT TYPE  (#PCDATA)>                                                      
<!ELEMENT DATE  (#PCDATA)>                                                      
<!ELEMENT TIME  (#PCDATA)>                                                      
<!ELEMENT SENDER (ADDRESS)>                                                     
<!ELEMENT ADDRESS EMPTY>                                                        
<!ELEMENT RECIPIENT (ADDRESS+)>                                                 
<!ELEMENT LANGUAGE  (#PCDATA)>                                                  
<!ELEMENT TEMP_ID  (#PCDATA)>                                                   
<!ELEMENT CONTENT  (#PCDATA)>                                                   
<!ATTLIST ADDRESS URI CDATA #REQUIRED>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]