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
Using meta characters for string search in XML using XML::LibXML in perl
I am reading a XML file and want to replace the XPath in "print" as "@href="*?releaseStatus=RELEASED" so that I will make it generic to get the first occurrence of the instance. How can I achieve that?
use XML::LibXML;
my $parser =…

Robie Nayak
- 819
- 10
- 18
0
votes
1 answer
Find and replace text using XML::LibXML
I want to find text enclosed by tilde (~) and prepend the text with some string, e.g. replace ~it~ with ~T1it~ in an XML file, then save the result to another file. I know how to get the text using XPath and how to replace it, but I don't know how…

siva2012
- 457
- 4
- 19
0
votes
1 answer
Why does XML::LibXML::Document's toString() give me "SCALAR(...)" instead of an XML string?
Here is a code sample that reproduces the behaviour I wonder about:
#!/usr/bin/perl
use strict;
use warnings;
use XML::LibXML;
my $myXMLdocument = XML::LibXML::Document->new();
my $myXML =…

Jean-Marc Liotier
- 237
- 3
- 8
0
votes
1 answer
How can I use Perl's XML::LibXML to extract content between tags?
I have an XML file with content like this:
www
How is it possible using XML::LibXML and Perl to take the content between the two nodes, ie "www"?
Thank you.

user1437832
- 19
- 4
-1
votes
1 answer
how to separate strings from descending xml nodes get by to_literal function from xml::xmllib module in perl?
I have XML structure in like this:
One
Two
Three
Four
...
...
Structure is big, complex and I know only begining, i.e: '/A'
and code in perl like this:
use XML::LibXML;
my…

user1285573
- 1
- 3
-1
votes
2 answers
Perl removing node
I'm starting with Perl, I know that there are some similiar questions answered, but (due to my lack of experiences) none of them was helpful.
I have xml like this:
Task_L2
…

JanFi86
- 449
- 10
- 29
-1
votes
1 answer
How to return separate results using XML::LibXML
I'm currently trying to use the following Perl code to filter an XML document for specific values.
use 5.010;
use strict;
use warnings;
use XML::LibXML;
my $filename = 'FF_BLADEII###_UNCP_12_Clips.xml';
my $dom = XML::LibXML->load_xml(location…

James
- 11
- 1
-1
votes
2 answers
Generate Two Seperate XML Files by Walking DOM Tree and Using Attributes
I need to segregate xml code into two separate files by using the optional attribute values. I prefer to use the XML::LibXML DOM methods, using Perl.
Sample XML code excerpt:
...
ZLAT

CraigP
- 453
- 1
- 3
- 17
-1
votes
1 answer
-1
votes
2 answers
Perl LibXML parse scaler from LWP HTTPS data
I am trying to get text from a website that is HTTPS. I have made this work with LWP, but I need to parse the information because it is XML. I think I have found out how to do what I want with XML::LibXML but I cannot access the data from…

CircuitB0T
- 465
- 2
- 6
- 19
-2
votes
1 answer
How to get all the content using fprintf in c
I'm trying to print all content of my file but I'm unable to print that to the filebut just first line is being printed, Suggest some way for the same.
First it was just printing 1 line when I hadn't used while loop
When I used while loop with !EOF…

Komal Pal
- 1
- 1
-2
votes
1 answer
setAttribute doesn't affect toString of containing element
This prints 100 WOWs, but not a single WOW in the toString. Why?
for my $node ( $body->findnodes('//a') ) {
$node->setAttribute( 'href', "WOW" );
}
for my $node ( $body->findnodes('//a') ) {
print $node->getAttribute('href');
}
print…

Dan Jacobson
- 490
- 3
- 14
-2
votes
1 answer
Expanding/collapsing or grouping the same lines in XML
As I know in some programs or in HTML webpages, they use benefit of plus/minus sing +/- that does the job collapsing/grouping.
I'm creating xml file using Perl and there are some identical lines/links which I want to group all such lines.
I am…

Royeh
- 433
- 5
- 21
-4
votes
1 answer
ERROR: XML::LibXML->load: specify location, string, or IO at 8.pl line 144
I am using the first answer to Extracting data from an XML document that uses namespaces to create an XML file using Perl.
Here is my code:
use strict;
use warnings;
use feature qw( say );
use XML::LibXML;
use XML::Simple;
use…

Royeh
- 433
- 5
- 21
-6
votes
1 answer
iphone os 4.0 and libxml2 and os 2.2.1
My project using libxml2 and i want to compile my application with iOS 4.0 with deployment target 2.2.1
but I am getting errors for libxml2 what is the way to do this.
I want compile on iOS 4.0 and deployment target to 2.2.1 with libxml2…

g.revolution
- 11,962
- 23
- 81
- 107