Hi,
unfortunately, there is no mailing list for users of the Xerces Perl
API, so I had to post my question to this mailing list. If there is a
better list, please tell me so.
Given the very simple XML file:
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to+)>
<!ELEMENT to (#PCDATA)>
]>
<note>
<from>Tove</from>
</note>
and the following Perl code:
$objParser = new XML::Xerces::DOMParser();
$objErrorHandler = new XML::Xerces::PerlErrorHandler();
$objParser->setToCreateXMLDeclTypeNode(1);
$objParser->setValidationScheme(Val_Always);
$objParser->setValidationSchemaFullChecking (1);
$objParser->setErrorHandler($objErrorHandler);
$objParser->setDoSchema(1);
eval
{
$objParser->parse($ARGV[0]);
};
if($@)
{
if(ref $@)
{
die $@->getMessage();
}
else
{
die $@;
}
}
print $objParser->getErrorCount(); # Gives 0!
I have just started using Xerces, so be patient. Am I missing
something? Shouldn't Xerces come up with an error, because the DTD
requires the "note" element to consist one or more "to" elements?
Best regards,
Tobias Wolff.
---------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]