473,545 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Parsing XML file with "."

3 New Member
Hi, I am using XML::Simple to parse the XML file that XML file contains the "." in some of its tags.

But while executing the script i am getting the error from Perl Script like "Use of uninitialized value in concatenation (.) or string".

I am aware of that this is because of the "." which is the concantation operator in Perl. But i want to parse the XML file without making nay chnages to it.
Sep 24 '07 #1
4 1857
3,509 Recognized Expert Moderator Specialist
Hi, I am using XML::Simple to parse the XML file that XML file contains the "." in some of its tags.

But while executing the script i am getting the error from Perl Script like "Use of uninitialized value in concatenation (.) or string".

I am aware of that this is because of the "." which is the concantation operator in Perl. But i want to parse the XML file without making nay chnages to it.

Why not post a sample of the data you are working with and also, in order to assist you, we will definitely need you to please post the code that you are working on. (placed in code tags please, as per the REPLY GUIDELINES to the right of the Message window when replying).

Once we have that, we can try to assist in your troubleshooting .


Sep 24 '07 #2
Shreedhar Naik
3 New Member
Hi as you informed i am posting the code here..

This is my Perl Code

use strict;
use XML::Simple;
use Data::Dumper;
my ($FILENAME, $Parser);
$FILENAME = "C:\\PerlScript \\Master.xml";
$Parser = XMLin($FILENAME );

print " $Parser->{properties}->{property}->{NCHOME.INSTAL LDIR}->{value}\n";

This is the XML File
<?xml version="1.0" ?>
- <CommonInstalle r version="1.0">
- <properties>
<property name="NCHOME.IN STALLDIR" value="[$NCHOME]" />
<property name="LICENSESE RVER.HOST" value="localhos t" />
<property name="LICENSESE RVER.PORT" value="27000" />
</CommonInstaller >

This is the Error i am getting while execute the Perl Scipt
Use of uninitialized value in concatenation (.) or string
Sep 25 '07 #3
Shreedhar Naik
3 New Member
By using the DataDumper the content of the XML file is displying properly. But when i try to extract an element indepedently it thwos the above ERROR
Sep 25 '07 #4
4,059 Recognized Expert Specialist
The problem is the hash key:


because it contains a dot you have to quote it:


the error message has nothing to do with the dot in the hash key or the dots in the xml file. That is a generic error message you get when warnings are turned on and you try and print a variable that has not been initialized.
Sep 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

by: MistralZ | last post by:
Hi all! I am using Oracle XML parser ver for C++ and I am having a strange problem with quotes. Parser throws a parsing error when trying to parse attributes containing quotes (even escaped: &quot; ). Does anyone know what the problem is? Example: attrName=" &quot; hello &quot; " Error: LPX-00240: element -start tag is not well...
by: David Walker | last post by:
Hi, I have an XML file created by a third party in which an element with a simple content model has a text value consisting of 2 parts separated by a colon, like this <link>machine:port</link> Is XSLT capable of parsing the value of a <link> element, to separately extract the portions before and after the colon?
by: samadams_2006 | last post by:
Hello, I have a peculiar problem that I'm hoping someone can help me out with. I have a simple enough Web Application written in VB.Net via Visual Studio 2003. It simply displays a Web Form with a label field saying "Hello". When I run this application interactively via Visual Studio 2003, I have no problems. When I transfer this code...
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set contents ]; close $fileID
by: Julian | last post by:
Hi, I am having problems with a function that I have been using in my program to read sentences from a 'command file' and parse them into commands. the surprising thing is that the program works fine on some computers and not so fine on others. I tried debugging and cannot make any sense of it. I narrowed it down to the seekg function and...
by: Steven Borrelli | last post by:
Hello, I am using the <?php include() ?statement on my website for organizational purposes. However, one of my includes contains some PHP code. Is there any way for the server to actually parse the include? I've tried this before, and it did not parse the include. Rather, it included the file as just plain ASCII. =======================...
by: souravmallik | last post by:
Hello, I'm facing a big logical problem while writing a parser in VC++ using C. I have to parse a file in a chunk of bytes in a round robin fashion. Means, when I select a file, the parser will read first 512kb(IBUFFSIZE) of data, then move to next file and parse the same way. This way I can parse a number of file spreaded over different...
by: jariwaladivyesh | last post by:
Hi frnds, i have simple XML doc <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <data> <name> Divyesh Jariala</name> </data>
by: bruce | last post by:
Hi Fredrick Thanks for the reply. But since I don't have control of the initial text, is there something with python that will strip/replace this... or are you saying I should do a search/replace on the "&" char with the "amp&;" prior to parsing??
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.