Questions tagged [xml-libxml]

For the Perl XML parsing module. For the C library libxml2, use the libxml2 tag.

225 questions
2
votes
1 answer

Need help to create XML file using perl XML::LibXML

refering to this solution, in this question, < How can I include nested elements within root element to create XML from scratch using perl XML::LibXML > I tried to use this approach and I have arrived at this…
Perl_Newbie
  • 101
  • 6
2
votes
1 answer

Perl, LibXML and Schemas

I have an example Perl script which I am trying to load and validate a file against a schema, them interrogate various nodes. #!/usr/bin/env perl use strict; use warnings; use XML::LibXML; my $filename = 'source.xml'; my $xml_schema =…
Xetius
  • 44,755
  • 24
  • 88
  • 123
2
votes
2 answers

XML::LibXML - problem installing the module on a fresh macOS BigSur

I've been successfully using XML::LibXML module for a while on macOS. Now I am trying to install it on a new machine with macOS BigSur: perl Makefile.PL make make test make install However, in "make test" I get multiple errors of the…
2
votes
1 answer

perl XML::LibXML not selector

In the following HTML snippet:

I want to select only the second p element (with the a class and without the b class) using not selector as follows: p.a:not(.b) The xpath…
jonah_w
  • 972
  • 5
  • 11
2
votes
3 answers

Is XML::LibXML not supported on Perl 5.8.8?

I answered a question on SO a while back where I initially suggested using XML::DOM. After mirod suggested that I use XML::LibXML instead, I implemented it. And to be honest, it works great on my system. I saw my runtime drop drastically with the…
Bee
  • 958
  • 5
  • 12
2
votes
2 answers

Perl libXML search the default namespace using findnodes

Given a XML file with multiple namespaces defined, what is the simplest way to search the DOM for elements just in the default namespace using an XPath query? As the title suggests this is using Perl and libXML. Furthermore, is it possible to do…
maloo
  • 380
  • 4
  • 12
2
votes
1 answer

How to insert a literal '&' using setAttribute()

I am using XML::LibXML (2.0018; perl 5.16.3) I have a hash that contains a series of attribute that are then applied to an XML document using setAttribute(). This stuff is for updating a tomcat server.xml file that needs to be modified to work with…
KevinO
  • 4,303
  • 4
  • 27
  • 36
2
votes
2 answers

XML::LibXML findnodes() does not return results when xmlns is present

I'm using XML::LibXML::Reader to parse a large document and have run into an issue whereby the attribute xmlns causes findnodes() to fail. I fixed it by added a regex to remove the xmls attribute but I was wondering if there was a more elegant…
dgate
  • 51
  • 7
2
votes
6 answers

Should I Use Regex to Find the XML Namespace Definition?

The script below works. It parses a XML and looks up a particular node under the namespace "dei". But is relying on regex for the namespace definition the proper way? (I do not really know XML. So I worry that such regex is not fool-proof for…
Shang Zhang
  • 269
  • 1
  • 8
2
votes
2 answers

iterating through elements using libxml in perl

I have an XML file like below,
V9 Red Indices 9 2017-03-16
ITRAXX-Asian iTraxx…
BRATVADDI
  • 199
  • 1
  • 2
  • 10
2
votes
1 answer

Perl XML::LibXML usage

I am having some trouble using XML::LibXML and I'd like to know if there is a way to do what I want to do, or if my XML should be changed. at the moment, my XML looks like :
olivierg
  • 728
  • 7
  • 26
2
votes
1 answer

best practices when using Perl modules

i'm basically new to modules and i'm trying to use them in my scripts. i am having trouble finding the right way of using them properly and i'd like your advice about it. let me explain quickly what i'm trying to do : my script is doing some file…
olivierg
  • 728
  • 7
  • 26
2
votes
1 answer

Can't locate XML/LibXML/Element.pm in @INC

I have installed XML:LibXML using CPAN but still getting the below error: Can't locate XML/LibXML/Element.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl…
Ras
  • 53
  • 6
2
votes
2 answers

Error can not load such file -- libxml_ruby (LoadError)

i am a newbine in ruby. I just install success module libxml-ruby. When i run a script which has require 'xml', it apprears error: C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file --…
Văn Khang Đinh
  • 75
  • 1
  • 1
  • 6
2
votes
1 answer

Perl library not working on WampServer

I'm developing a website for a university project, using WampServer and Perl. Some details: Using Windows Vista Latest Strawberry Perl installed on C:\Strawberry\perl\bin\perl Wamp 2.5 32 bit installed on C:\wamp I followed all the Apache…
Skitinudo
  • 31
  • 4