> > what you told me I already did.
>
> Sorry about that.
No problem about that.
>
> I had hoped that they were more clear... Any suggestions as to how to
> make them more useful are welcome.
>
Erm, for a trained C programmer they're good I think. But I just started to
learn C in my spare time (I have a basic understanding of C)...
> If you've set DoSchema, it will use a schema to validate the document,
> if you haven't it will expect a DTD.
>
this is the header of the XML I receive:
<!DOCTYPE PXMLServiceRequest SYSTEM "D:\DTD\PXMLServiceRequest.dtd">
But the DTD is not in that place off course. Where in the program do I set
where the DTD is?
In my other code I do(just to illustrate what I want):
use strict;
use XML::LibXML;
# Here I read my dtd in a string
my $dtdstr = do {
local $/;
open(DTD, 'XMLS/PXMLStatusMessage.dtd') || die $!;
my $str = <DTD>;
close DTD;
$str;
};
# Set validation on
XML::LibXML->validation(1);
# pars XML and DTD
my $dtd1 = XML::LibXML::Dtd->parse_string($dtdstr);
my $xml1 = XML::LibXML->new->parse_file('XMLS/PXMLStatusMessage.xml');
# To ways to check validation. Both work rather well :)
if(!$xml1->is_valid($dtd1)) {
print "Our XML is not valid!!!\n";
}
eval { $xml1->validate($dtd1); }; print $@ if $@;
Like you see also with error handling :)
(Sorry about the use of anorher module)
> my $error_handler = XML::Xerces::PerlErrorHandler->new();
> $parser->setErrorHandler($error_handler);
Yup I saw that in the example and understood the use :)
> Once you're done, getDocument() will give you the Document object,
> with which you can begin picking apart the information...
With the parsing part I don't have any problems.
Thanx for the support.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]