From: PERRIN B. <ber...@cs...> - 2002-02-20 13:12:17
|
Hi, I'm using tclxml version 2.1 theta. I tried to parse xml files with an external dtd file. I would like to validate my xml file, so I use: set parser [::xml::parser -validate 1 ....] However, even when my xml file is incorrect (according to the dtd) I never get an error. Can I really use this tool for validation? Do I miss something? The same test works fine with libxml2. Below are the files that I use. Thanks for any suggestion, Bernard ex1.dtd: <!ELEMENT tutorial (#PCDATA)> ex1_ok.xml: <!DOCTYPE tutorial SYSTEM "ex1.dtd"> <tutorial>This is an XML document</tutorial> ex1_ko.xml: <!DOCTYPE tutorial SYSTEM "ex1.dtd"> <text>This is an XML document</text> validate.tcl: package require xml cd d:/tclxml-2.1theta/examples set fp [open "ex1_ko.xml" "r"] set parser [::xml::parser -validate 1 -baseurl "file://d:/tclxml-2.1theta/examples/"] $parser parse [read $fp] close $fp |