ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
XML DTD validation
by Bradley Slavik other posts by this author
Jun 19 2009 9:29AM messages near this date
view in the new Beta List Site
Re: xpath problem with XML::XPath and LibXML | Re: XML DTD validation
& XSLT Dear Perl XML list,

I have been working with XML::Checker::Parser (part of libxml-enno)
and found that many of the tests are broken, and it probably could
use to be upgraded to using Test::More. I have fixed most of it, but
maybe I should be expending my efforts on a different perl package?

Is there a better package in Perl to validate XML files against DTDs or Schemas?
I currently only have DTDs for these XML files.

It was interesting to see this project as well: http://vtd-xml.sourceforge.net/
but I did not see how to use it for validating DTDs or Schemas.

This project also looked promising: http://www.textuality.com/Lark/

And there is always the faithful libxml and Xerces to fall back on.

I just want to get a little feedback, so if I do this, it is done
right and benefits the perl/xml community as a whole, not just me.

It would be nice if someone who has submitted CPAN modules previously
could look over the code before I submit it. I feel confident there are some
nice perl idioms for packages that might make the package more standard.

I just learned the perl Test packages today. I think if the libxml-enno
is still in favor then I should clean up the test suite and go over the
code. Here is an example of a simple question that I just don't know the
answer to:

Lines 223 and 249 of t/chk_batch.t:

local *XML::DOM::warning = \&append_str;

which produces this error during testing:

Subroutine XML::DOM::warning redefined at t/chk_batch.t line 223.
Subroutine XML::DOM::warning redefined at t/chk_batch.t line 249.

It is pretty lame, and there is probably a better way to do it, but if it
is better to overwrite it, how to avoid the warning? I now know that I
can use no warnings to get around this, but is this the BEST perl practice?

Here is the subroutine (so you don't have to look it up)

sub append_str
{
$error_str .= shift() . "\n";
}

Probably there is an accepted idiom to use for this purpose when
writing tests, and I would rather go with the flow than create my own
wheel. I am not trying to get someone else to do the work here, just
hoping to get a modicum of support.

Thanks for your assistance.


Bradley Slavik
fire@[...].net



_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Bradley Slavik
Shlomi Fish
Petr Pajas

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved