Posted to tcl by aspect at Wed Jul 30 02:59:32 GMT 2014view pretty
# using example documents from http://msdn.microsoft.com/en-us/library/ms256129%28v=vs.110%29.aspx % package require xml 3.3 % set xsd [dom::parse [readfile po.xsd]] doc3 % set xml [dom::parse [readfile po.xml]] doc4 % set badxml [dom::parse [readfile badpo.xml]] doc5 % $xsd schema compile % $xsd schema validate $xml % $xsd schema validate $badxml {schemas-validation error 1871 ::dom::doc5::node0 25 {Element '{http://tempuri.org/po.xsd}productName': This element is not expected. Expected is ( {http://tempuri.org/po.xsd}item ). } 0 0}