For the Perl XML parsing module. For the C library libxml2, use the libxml2 tag.
Questions tagged [xml-libxml]
225 questions
0
votes
1 answer
Libxml - replace xml value if particular conditions are met
I have an incomplete Perl script with the following content:
use XML::LibXML;
use XML::LibXSLT;
my $xml_mess = "
id_119604
id_342432
";
my $parser = XML::LibXML->new();
my $xml_mess_obj…

methuselah
- 12,766
- 47
- 165
- 315
0
votes
1 answer
Find and Replace and attribute in XML file using libxml/xpath in C program
I have a xml file which has different sections and i need to 'rename' certain attributes appearing in this huge file (like find and replace with new name). All over i have used libxml and xpath to modify and satisfy other requirements, but for this…

P K M
- 13
- 2
0
votes
1 answer
Replace node using XML:LibXML
I am trying to replace some nodes value in XML using the XML:LibXML file parser from user input.
Example XML:
NA
NA
NA
Code:
use strict;
use warnings;
use…

Blurman
- 195
- 9
0
votes
1 answer
Perl get XML node value using XML:LibXML
I am trying to print out content of nodes to do further process. Wanted to print x_id="123" and node "a" content. I am using XML:LibXML parser. Any suggestion? I am very new to this file parser.
Example XML:
…

Blurman
- 195
- 9
0
votes
1 answer
XML::LibXML::Pattern failed to install
I'm using XML::LibXML to read a large xml file. Below is a snippet of the code:
use XML::LibXML::Pattern;
next unless $reader->matchesPattern($doc_pattern);
As you can see, I need to install the XML::LibXML::Pattern module. Here is the log info…

jonah_w
- 972
- 5
- 11
0
votes
2 answers
XML:Find particular node in XML using LibXML
I have an XML file which has only one node called import. I want to find the href attribute of import. I tried using findnodes(), but that returns a list I would have to search further, so I was hoping there was a way to find a particular node which…

user1677804
- 31
- 4
0
votes
0 answers
Filtering a subtree from an XML
There is an API xmlTextReaderPreservePattern() to filter all nodes matched by pattern (say "test"). Is there a way to filter a sub-tree from XML?

Bose
- 381
- 3
- 16
0
votes
1 answer
XML::LibXML::Reader return value without cdata tag
I am reading an xml file with XML::LibXML::Reader
my $reader = XML::LibXML::Reader->new(IO => $fh, load_ext_dtd => 0) or die qq(cannot read content: $!);
while ($reader->nextElement( 'item' )) {
my $copy = $reader->copyCurrentNode(1);
my…

Ian
- 13,724
- 4
- 52
- 75
0
votes
1 answer
Installing libxmlsec1 on windows
I am trying to provide SSO via OneLogin in my Flask/Python (2.7) app on windows.
I am trying to use sample app provided by OneLogin and currently going through installation of required packages. I hit a dead end with libxmlsec1. While I was trying…

Kay
- 1,235
- 2
- 13
- 27
0
votes
1 answer
Namespace error while parsing xml namespace with multiple URIs in perl
use XML::LibXML;
use strict;
use warnings;
my $parser = XML::LibXML->new();
my $xmldata = '

andor
- 75
- 8
0
votes
1 answer
Concatenate elements from multiple XML files
I need to open and parse several XML files, keeping the data in memory, and then sort the result.
The script is not finished because I don't know how keep the information in a hash or a variable, that's why I need your help.
Perl…

Seth
- 364
- 1
- 16
0
votes
1 answer
Perl LibXML adding nodes in a loop
I'm trying to add nodes from one document to a new document I create, but it's not working and I don't know why. Here's the code that's going wrong:
my ($body_node) = $newdoc->findnodes('//body');
my @nodes =…

dgate
- 51
- 7
0
votes
2 answers
Find / Replace values using XML::LibXML with Perl
I've read some others topics here but this doesn't fit to my sample.
I have an XML file where I want to find and replace specific values.
My script is working with expecting result, but it's quite ugly because I don't use all reassources from the…

Seth
- 364
- 1
- 16
0
votes
1 answer
XML::LibXML findvalue for an attribute with a namespace prefix
I am having some issues using
XML::LibXML
with namespaces. I have parsed files with namespaces before but this one is a bit different because it is defined with xlmns:abc rather then just xlmns.
I can't extract the 893 value of abc:id from this…

personalt
- 810
- 3
- 13
- 26
0
votes
1 answer