Questions tagged [xml-libxml]

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

225 questions
13
votes
2 answers

Perl XML::LibXML $node->findnodes($xpath) finds nodes it shouldn't

Here's some code I am having problems with, I process some XML and in a method in an OO class I extract an element from each of several nodes that repeat in the document. There should only be one such element in the subtree for each node but my code…
RedGrittyBrick
  • 3,827
  • 1
  • 30
  • 51
10
votes
2 answers

XML::LibXML replace element value

I want to replace a "VAL1" value of an element in xml file For some reason it does not work for me: TEST VAL1 1234
Gregory Danenberg
  • 519
  • 2
  • 9
  • 15
9
votes
2 answers

Extracting data from an XML document that uses namespaces

I have some XML files where I want to use some information from them. I have written a code that reads those files and then looks for some conditions. The problem is that these XML file begins with
Royeh
  • 433
  • 5
  • 21
7
votes
2 answers

Missing files libresolv.9.dylib and libxml2.dylib

I have an old Xcode project for iOS where I used libxml2.dylib and libresolv.9.dylib. After installing XCode7. I can't find the files and I don't know where to search. Can someone help me?
Lorenzo
  • 3,293
  • 4
  • 29
  • 56
7
votes
3 answers

Can't locate XML/LibXML.pm

I installed Strawberry Perl on my windows XP operating system. Later I tried to execute the .XML file but it's throwing error as below. I also tried Active Perl and also getting the same error. I am running the following code in the command…
venkatappa jv
  • 81
  • 2
  • 2
  • 3
7
votes
4 answers

Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML

I have downloaded strawberry PERL and writing one application with CGI Perl Apache on Winxp sp3). One of the libraries (written by someone else) which I using uses XML::LibXML. When i load the page it gives Internal Server Error. From Apache error…
6
votes
2 answers

How can I auto-indent XML nodes with XML::LibXML?

I'm adding nodes to my XML document as part some in-house processing, but cannot get XML::LibXML to auto-indent the added nodes. I get output like the following: Here's what I'm currently getting with $xml->toString( 1 ): …
Zaid
  • 36,680
  • 16
  • 86
  • 155
6
votes
1 answer

cpan can't install XML::LibXML on macOS Catalina

I'm using cpan install XML::LibXML to try to install XML::LibXML parser, but it won't pass. It gives the following errors: cc -c -I/usr/include/libxml2 -fno-common -DPERL_DARWIN -mmacosx-version-min=10.14 -fno-strict-aliasing -pipe…
jonah_w
  • 972
  • 5
  • 11
6
votes
2 answers

How to list XML node attributes with XML::LibXML?

Given the following XML snippet: text1 How do I get this output? outline node1=text1 node1 attribute1=value1 node1 attribute2=value2 I have looked into use…
6
votes
2 answers

XML::LibXML, namespaces and findvalue

I'm using XML::LibXML to parse an XML document with a namespace. I therefore use XML::LibXML::XPathContext to findnodes using the XPath //u:model. This correctly returns 3 nodes. I now would like to use findvalue on the 3 returned…
Miller
  • 34,962
  • 4
  • 39
  • 60
6
votes
1 answer

How can I access attributes and elements from XML::LibXML in Perl?

I am having trouble understanding / using name spaces with XML::LibXML package in Perl. I can access an element successfully but not an attribute. I have the following code which accesses an XML file (http://pastebin.com/f3fb9d1d0). my $tree =…
John
  • 5,139
  • 19
  • 57
  • 62
6
votes
3 answers

Perl XML::LibXML: how to access comment nodes

For the life of me I can't figure out the proper code to access the comment lines in my XML file. Do I use findnodes, find, getElementByTagName (doubt it). Am I even making the correct assumption that these comment lines are accessible? I would hope…
CraigP
  • 453
  • 1
  • 3
  • 17
6
votes
5 answers

How do I install XML::LibXML for ActivePerl?

I am new to Perl and I am using ActivePerl. I am getting the following error: Can't locate XML/LibXML.pm in @INC... I have tried everything but cannot find the steps to install the "correct" module for XML::LibXML. Here is exactly what is going…
Jamey McElveen
  • 18,135
  • 25
  • 89
  • 129
5
votes
1 answer

Why is XML::LibXML adding a child to one and not the other?

I'm seeing some odd behavior with XML::LibXML. The code below is intended to add 2005 to both nodes. Is something wrong here? I've tried changing the XPath query (//library/book ) but the result is the same. use strict; use…
Zaid
  • 36,680
  • 16
  • 86
  • 155
5
votes
1 answer

XML::LibXML - detect if two Elements are the same?

I'm working with XML::LibXML in Perl. Say I have two $element references gotten by different (opaque) XPath queries. (How) can I determine, if the two $element (Node) refs are the same element in the document tree? Comparing $el1 == $el2doesn't…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
1
2 3
14 15