Saturday, May 01, 2010
eCID - Android App
Please go to our new site: http://www.enhancedsmscallerid.com/
Tuesday, April 27, 2010
Getting rid of empty XML elements using XML::Simple
Sometimes it is necessary to remove empty XML elements from XML documents (need a condensed message, etc) and doing so can be a difficult task to achieve! Well, here comes XML::Simple to the rescue...
#!/usr/bin/perl -w
use strict;
use XML::Simple;
use Data::Dumper;
my $xml = <<EOF;
<fullletter>
<CASE_EPIS>00036</CASE_EPIS>
<letter>
<IMAGENAME>02_20100423124541</IMAGENAME>
<RUNDATE>2010-04-23 12:04:41</RUNDATE>
<LETTERTYPE>LOI2</LETTERTYPE>
</letter>
<service> </service>
<service>
<NTV_SEQUENCE>26</NTV_SEQUENCE>
<NTV_DISPLAY_VALUE>Need start date </NTV_DISPLAY_VALUE>
</service>
<service> </service>
</fullletter>
EOF
# use XML simple to process the XML
my $xs = XML::Simple->new(
# remove extra whitespace
NormaliseSpace => 2,
# keep root element
KeepRoot => 1,
# force elements to arrays
ForceArray => 1,
# ignore empty elements
SuppressEmpty => 1
);
# read in the XML
my $ref = $xs->XMLin($xml);
# print out the data structure
# shows you how to access the data
print Dumper($ref);
# print out the XML minus the empty tags
print $xs->XMLout($ref);Running this sample code then produces (minus the Data::Dumper text):<fullletter>
<CASE_EPIS>00036</CASE_EPIS>
<letter>
<IMAGENAME>02_20100423124541</IMAGENAME>
<LETTERTYPE>LOI2</LETTERTYPE>
<RUNDATE>2010-04-23 12:04:41</RUNDATE>
</letter>
<service>
<NTV_DISPLAY_VALUE>Need start date</NTV_DISPLAY_VALUE>
<NTV_SEQUENCE>26</NTV_SEQUENCE>
</service>
</fullletter>
Tuesday, February 16, 2010
Firefox (64 bit)
Just a quick note for those of you wanting a 64bit version of Firefox!
You can obtain a 64bit version here! For those of you that are daring, download and install Firefox.next (version is based on a time stamp).
For those wanting something that works, you should download a version after the list of files for Firefox.next (e.g. Firefox 3.6 below).
JAVA is available (and more stable from what I can tell) in 64bit flavors and I would recommend installing a 64bit version after installing a 64 bit version of Firefox
Note that Flash is not available for 64 bit browsers yet (unless you are on linux).
You can obtain a 64bit version here! For those of you that are daring, download and install Firefox.next (version is based on a time stamp).
For those wanting something that works, you should download a version after the list of files for Firefox.next (e.g. Firefox 3.6 below).
JAVA is available (and more stable from what I can tell) in 64bit flavors and I would recommend installing a 64bit version after installing a 64 bit version of Firefox
Note that Flash is not available for 64 bit browsers yet (unless you are on linux).
Subscribe to:
Posts (Atom)

