1

I want to validate xml against xsd file. So I would like to install libxml2 for the same. I have downloaded the zip file and extracted it to "C:\libxml2\libxml2-2.7.8". From here onwards I am not sure how to install the libxml2. Can anyone tell me the easiest way to install the libxml2? Also I have following questions.

  1. Choosing libxml2 is correct option or not?
  2. I was trying to use XML::Validator::Schema but couldnt validate the xml against xsd as it was complaining as "elementFormDefault in must be 'unqualified', 'qualified' is not supported." So I left this option.
  3. Is there any easiest way to validate xml against xsd (complete validation) so that I can avoid the pain of installing libxml2 in all my server machines.
  4. What is lxml2? Is it also required along with libxml2?
Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
user1019072
  • 299
  • 1
  • 7
  • 17
  • You'll need to give us some more information. What distribution of Perl are you using? (Both vendor and Perl version.) It looks like you're using windows, so this will likely either be ActiveState Perl or Strawberry Perl, each of which have their own methods for installing things...usually PPM for ActiveState and CPAN for Strawberry Perl. – Robert P Nov 01 '11 at 18:15
  • I am using perl version v5.8.3 on windows. I have CPAN but dont have PPM on my server machines. – user1019072 Nov 01 '11 at 19:07

3 Answers3

1

Is it possible for you to upgrade Perl? Strawberry Perl bundles XML::LibXML. Otherwise you need a compiler to install XML::LibXML or install it with PPM, as eman says.

Alexandr Ciornii
  • 7,346
  • 1
  • 25
  • 29
0

You just then need to call xmllint.exe through a system call with the appropriate arguments.

Edit :

since you want to do this purely in perl :

Why does my XSD file fail to parse with XML::LibXML?

How can I validate XML with XSD in Perl?

Community
  • 1
  • 1
FailedDev
  • 26,680
  • 9
  • 53
  • 73
  • Hi, I forgot to tell you that I have to validate xml against xsd using PERL program. So I am trying to install XML::LibXML which requires libxml2. So Can anyone help me to provide step by step procedure to install libxml2 in windows? – user1019072 Nov 01 '11 at 20:35
  • Hi, I am unable to install XML::LibXML module because I am unable to install libxml2 in windows. That is where I need help. Once I am able to install these modules then I can use the code that you have given to validate xml against xsd. – user1019072 Nov 01 '11 at 21:00
  • @user1019072 What does it mean unable to install? Are you using active state's perl? Just use the PPM manager. – FailedDev Nov 01 '11 at 21:16
0

As you can see at http://kobesearch.cpan.org/dist/XML-LibXML there are ppms available for 5.8 from bribes, tcool, and uwinnipeg PPM::Repositories , so install PPM, add the repositories, and install XML::LibXML

eman
  • 1