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
60
votes
3 answers

Why is XML::Simple Discouraged?

From the documentation of XML::Simple: The use of this module in new code is discouraged. Other modules are available which provide more straightforward and consistent interfaces. In particular, XML::LibXML is highly recommended. The major problems…
Sobrique
  • 52,974
  • 7
  • 60
  • 101
29
votes
5 answers

XML::Parser refusing to install

I've been trying to install XML::Simple on Ubuntu 12.10 for the past two hours or so and have officially run out of ideas. It's failing at the XML::Parser. I've done an sudo apt-get install expat and it still did not work. Here's the error I've…
user1496777
  • 358
  • 1
  • 4
  • 10
6
votes
2 answers

XML::Simple output element order from complex hash

I have already seen few answers on various places, in regards to setting the order of XML elements being returned by XMLout. However, I am not able to solve a problem using those answers/examples. I have a script that needs to output some XML data,…
sentinel
  • 249
  • 2
  • 10
5
votes
1 answer

Perl xml simple for parsing node with the same name

I have the following xml file
user1876128
  • 91
  • 14
4
votes
1 answer

SimpleXML root node prefix php

I'm trying to create XML with php: this is true XML
Bombo
  • 137
  • 1
  • 1
  • 10
3
votes
2 answers

'not well-formed' error using Perl XML::Simple

I am trying to run a Perl script to get all the elements of an xml document into an array. The code is as follows: #!/usr/bin/perl # Script to illustrate how to parse a simple XML file # and dump its contents in a Perl hash record. use strict; use…
Scotti
  • 289
  • 4
  • 9
3
votes
2 answers

XML::Simple ignoring emdash tag?

I'm using XML Simple to parse an XML file, the problematic part looks like that: <titlePart> <text>SECTION A <emdash/> HUMAN NECESSITIES</text> </titlePart>
snoofkin
  • 8,725
  • 14
  • 49
  • 86
3
votes
2 answers

Does XML::Simple maintain order when using arrays?

I'm using XML::Simple to parse an XML file which I then want to use to write an output file in a very specific format. Thus, the output order is important. As I understand it, when the XML is converted to the perl hashref the order is lost (because…
curtisvo
  • 43
  • 4
3
votes
1 answer

Using xml::simple - unable to get specific format output

Input file :SN.xml value1 I am using these code for…
Vasanth
  • 201
  • 1
  • 12
3
votes
1 answer

Perl XML-SAX-Expat external entity location

I am using XML-Simple along with XML-SAX-Expat to parse a document with external entities. I declare my entity like: And I refer to from another file in the same directory. However, it is searching my current…
brianegge
  • 29,240
  • 13
  • 74
  • 99
3
votes
1 answer

Case-sensitive XML parser for Ruby

I'm currently using XmlSimple in Ruby to convert XML to a hash using the xml_in method. Everything is really nice, except for the fact that the resulting hash keys are all lowercase, whereas the XML element names were mixed-case. Here's an…
dsw88
  • 4,400
  • 8
  • 37
  • 50
3
votes
2 answers

printing XML array values

I'm trying to extract a small amount of data from an XML file into a csv file using perl and XML::Simple. Here is an edited version of the data:
Scott Wood
  • 1,077
  • 3
  • 18
  • 34
3
votes
3 answers

Perl code for Find and replace a tag value in XML

Below is the XML I will be using: ABC I want to write a Perl code which search for tag 'id' and replace the value "ABC" with "DEF". However the nesting of above XML can change. So I want to make a generalized…
Praful Mathur
  • 159
  • 3
  • 12
3
votes
2 answers

Is it possible to catch die messages that happen inside another perl module?

I have a SOAP client written in Perl using LWP package for the HTTPS transport and XML::Simple for the parsing of the XML payloads. From time to time the call to XMLin fails with a die() and then my script dies and has to be restarted by a…
mathematician1975
  • 21,161
  • 6
  • 59
  • 101
3
votes
1 answer

How do I access data in a nested data structure from XML::Simple?

I have to write a Perl script to convert an XML file into a CSV file. I've already written something simple in one context, and need to enhance it for a different dataset, and can't quite figure out what to do. I'm using XML::Simple. Here is one…
Scott Wood
  • 1,077
  • 3
  • 18
  • 34
1
2 3 4 5 6 7 8