Questions tagged [xml-simple]

The "simple" libraries for working with XML in Ruby or Perl.

The Perl XML::Simple module or the XmlSimple Ruby gem.

111 questions
2
votes
1 answer

How to parse XML with Mechanize and XMLSimple in ruby?

I'm trying to fetch a remote XML file with Mechanize to get icecast status information. But I'm having problems to pass the XML file from Mechanize::File format to string or some XML format which XMLSimple can work with. The XML document looks like…
q9f
  • 11,293
  • 8
  • 57
  • 96
2
votes
2 answers

perl, parsing XML using XML::Simple

I'm doing something wrong when parsing XML. Somehow I has to iterate two loops, where only one should be needed. What am I doing wrong here? First the xml data:
daljian
  • 102
  • 1
  • 11
2
votes
1 answer

Loop through XML::Simple structure

So I have some xml file like this: true
David
  • 325
  • 1
  • 3
  • 11
2
votes
6 answers

How do I convert Data::Dumper output back into a Perl data structure?

I was wondering if you could shed some lights regarding the code I've been doing for a couple of days. I've been trying to convert a Perl-parsed hash back to XML using the XMLout() and XMLin() method and it has been quite successful with this…
newbee_me
  • 31
  • 1
  • 1
  • 3
1
vote
4 answers

Perl, Parsing XML with XML::Simple and Having Issues

I am parsing xml files in Perl and everything seems to work great with one issue. I have files with the same schema, but they are returning different types of data from the parser. Here is a simplified example:
srowley
  • 837
  • 1
  • 12
  • 24
1
vote
2 answers

XML::Simple doesn't seem to work with a URL. Is this correct?

I am using the following script: #!/usr/local/bin/perl -wT use strict; use warnings; print "Content-type: text/html\n\n"; print "xml reader"; # use module use XML::Simple; use Data::Dumper; #print Dumper (XML::Simple->new()->XMLin()); and it…
Hedley Phillips
  • 389
  • 1
  • 8
  • 16
1
vote
2 answers

How do I dynamically generate XML?

I actually asked this question in a different form before. I did get a great answer but I thought I needed more clarifications, so I am asking it in its whole form again. The user would script something like: $ABC->Command(100, 100); my $group =…
MarsMax
  • 91
  • 1
  • 8
1
vote
2 answers

how to parse a simple xml file to a readable format

Perl newbie here. Can someone kindly show me how to use perl to extract data from this xml file and format the output anyway i would need? Would I use XML::Simple or open this as a fh and split it somehow? thank you. Documentation for using…
cjd143SD
  • 859
  • 7
  • 17
  • 28
1
vote
2 answers

XML::Simple encoding problem

I have an xml-file I want to parse: û It's perfectly parsed by firefox. But XML::Simple corrupts some data. I have a perl-program like this: my $content = "
pacefist
  • 11
  • 1
  • 3
1
vote
1 answer

Uninitialized constant XmlSimple, but I included the proper gem

I'm trying to use the XmlSimple gem in a script. My script looks like this: #!/usr/bin/env ruby gem 'xml-simple', '1.1.5' xml = XmlSimple.xml_in('test_data.xml') puts xml This fails with the error: ./script.rb:5:in `
': uninitialized…
Kevin
  • 14,655
  • 24
  • 74
  • 124
1
vote
1 answer

Parsing João with xml-simple

I am using the xml-simple gem inside a rake task to parse the contents of a db dump. The problem is that the database xml file contains characters like those in the title that causes xml-simple to crash. Is there a work around to this?
Eric M.
  • 5,399
  • 6
  • 41
  • 67
1
vote
1 answer

Perl Object to XML Using XML::Simple

I'm attempting to use the XML::Simple CPAN module to convert output from our database into a simple XML structure. The problem is that the output being returned isn't what I was hoping for no matter what options I attempt to pass to XML::Simple. The…
Russell C.
  • 1,649
  • 6
  • 33
  • 55
1
vote
2 answers

Trouble in reading values from parsed XML data using XML::Simple

I am half way through writing a script using XML::Simple. I have read that is not so "simple", and even its own documentation discourages its use in new code, but I have no other choice as this script will be an extension to existing code. What I am…
300
  • 965
  • 1
  • 14
  • 53
1
vote
3 answers

XMLsimple get value of next element

This is a small part of the XML file I am reading: D5023 true 2015-06-11T16:04:23.887 525
Kaspar
  • 107
  • 1
  • 6
1
vote
1 answer

Ruby cannot find gem in gemset

I apologize if I've missed something obvious. I am new to Ruby. My overall goal is to add functionality to an existing script, which is using rvm and gemsets. When I install new gems to a particular gemset, the requires in my scripts fail to find…
vincent
  • 1,305
  • 2
  • 12
  • 16