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
0
votes
1 answer

How do I encode key-value pairs using Perl's XML::Simple module?

I have a hash of the form my $hash = { 'Key' => "ID1", 'Value' => "SomeProcess" }; I need to convert this to an XML fragment of the form Some Process a Some Process b
MarsMax
  • 91
  • 1
  • 8
0
votes
1 answer

XML SIMPLE PERL - Looping through child nodes problem

I have some perl code my $res = $ua->get( $access->to_url ); if ($res->is_success) { my $ref = XMLin( $res->content ); my $xml = new XML::Simple; $data = $xml->XMLin($res->content,ForceArray => 1); #print $res->content; for my…
Fabio
  • 49
  • 6
0
votes
1 answer

XML::Simple convert xml to perl hash warning "non-unique value"

I have a well formed XML that I'm trying to convert to a hash with perl module XML::Simple. There are some section in this file which cannot be parsed correctly. Is there any way (or a workaround) to get the xml parsed correctly and get the desired…
PaulP
  • 3
  • 4
0
votes
1 answer

How can XmlSimple output XML just like data.to_xml?

Can XmlSimple.xml_out output XML the same way to_xml does? (instead of attributes, use tags): > puts XmlSimple.xml_out([{'a' => 1, 'b' => 3.3}]) > puts ([{:a => 1, :b => 3.3}].to_xml)
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
1 answer

Perl XML::Simple Inconsistent behavior

I am reading XML file using XML::Simple However, I am facing a rather "odd" situation wherein XML::Simple is behaving inconsistently across hosts I can best guess that the shell has some role to play - but I can't be sure as I didn't find any such…
Soumya
  • 885
  • 3
  • 14
  • 29
0
votes
3 answers

Getting elements from XML file in Perl

I have a file on a server that I want to parse in Perl. I've tried it with XML:Simple and XML:LibXML and I can't get the xml elements in both cases. This is my .xml file:
dbz
  • 411
  • 7
  • 22
0
votes
1 answer

Sorting XML elements by their attribute values

I have the following XML
tchike
  • 154
  • 4
  • 21
0
votes
1 answer

Get the attribute by topic->icon_id

I'm trying to show the topic icon by xml. How can I get the icon from the right icon id. Now he is always loading id 0. Thank you for the help. I tried and searched suggested examples, but no luck. xml:
810
  • 15
  • 1
  • 5
0
votes
1 answer

ruby gem xml-simple: same output for different input

I'm struggling with the xml-simple (1.1.5) gem. This is my input in test.xml: <br/>X X<br/>X X<br/> Now see what happens using irb as follows: $ irb -rxmlsimple -rpp >> pp…
0
votes
1 answer

XMLin with strings containing invalid xml characters

I am using XML::Simple in one of my perl scripts to extract some messages, problem is I am getting this error : No semi-colon found after entity name [Ln: 1, Col: 151] when I use XMLin( $msg ) and $msg contains an invalid character like '&' I know…
SomeDude
  • 13,876
  • 5
  • 21
  • 44
0
votes
2 answers

Referencing top level of xml object using xml::simple in perl

Been banging my head against the wall trying to figure this out. Just trying to put together a script that will eventually link together various components of these game files (like for a wiki). I'm sure this is a simple matter of not doing the…
Calbrenar
  • 31
  • 7
0
votes
1 answer

Is there any way to have XML::Simple output CDATA?

If I'm on a system with just XML::Simple installed, and I'm reading a database to output an XML representation of some of it, and some of that data has HTML code which needs to be surrounded by the CDATA tag... is that possible? I really don't want…
Dan Goodspeed
  • 3,484
  • 4
  • 26
  • 35
0
votes
2 answers

Filter Simple-XML Output in ruby

I'm absolutely new to ruby and I'm trying to parse an XML structure and filter it for some attributes. The XML looks like this:
elcravo
  • 3
  • 2
0
votes
1 answer

Trouble with a one-node XML file in Perl

I have many multi-node XML files that I'm parsing with XML::Simple. So far it works great. One of the first things I do is get the length of the XML file (node count) using this: my $xmltemp = XML::Simple->new( SuppressEmpty => 1 ); my $product…
dbonneville
  • 2,079
  • 4
  • 19
  • 26
0
votes
1 answer

Parsing XML file to count tag occurrence using XML::Simple

I'm attempting to parse an XML file using XML::Simple in order to count the occurrence of specific tags(i.e. the occurrence of different city locations specific to a title that gets repeated throughout the file in order to do further analysis on the…