[Omaha.pm] Validating XML Messages with Perl on Linux/Unix

Jay Hannah jhannah at omnihotels.com
Mon May 1 11:42:05 PDT 2006


Neat...  Any XML gurus lurking in the Omaha Perl Mongers?

j



-----Original Message-----
From: OTA-Impl-Forum at googlegroups.com
[mailto:OTA-Impl-Forum at googlegroups.com] On Behalf Of Stephen Adkins
Sent: Saturday, April 22, 2006 11:36 PM
To: OTA-Impl-Forum at googlegroups.com
Subject: [OTA-Impl-Forum] Validating XML Messages with Perl on
Linux/Unix


Hi,

I found an interesting utility on CPAN to validate XML files:
XML-Validate.

It will validate with XML::LibXML (which is built on Gnome's libxml2,
see http://xmlsoft.org/), with XML::Xerces (which I described how to
install in a previous post, and see http://xml.apache.org/xerces-c/),
or with MSXML (if on Windows), whichever is installed.

Assuming that you have installed XML::Xerces as per the earlier post
and the OTA specification files as per another post, you can get
validation going with the following commands.

INSTALL XML::Validate

   su -
   perl -MCPAN -e "install XML::Validate"
   exit

VALIDATE THE SAMPLES

   cd $HOME
   mkdir tmp
   cd tmp
   cp $PREFIX/share/ota/2005B/schema/*.xsd .
   cp $PREFIX/share/ota/2005B/samples/*.xml .
   validxml.pl OTA_VehResRQ.xml
   for file in *.xml
   do
      validxml.pl $file
   done

Stephen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "OTA Implementers Forum" group.
To post to this group, send email to OTA-Impl-Forum at googlegroups.com
To unsubscribe from this group, send email to
OTA-Impl-Forum-unsubscribe at googlegroups.com
For more options, visit this group at
http://groups.google.com/group/OTA-Impl-Forum
-~----------~----~----~----~------~----~------~--~---


More information about the Omaha-pm mailing list