473,700 Members | 2,725 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 1867
numberwhun
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 .

Regards,

Jeff
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" />
</properties>
</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
KevinADC
4,059 Recognized Expert Specialist
The problem is the hash key:

{NCHOME.INSTALL DIR}

because it contains a dot you have to quote it:

{'NCHOME.INSTAL LDIR'}


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

2
5416
by: MistralZ | last post by:
Hi all! I am using Oracle XML parser ver 9.0.1.0.0 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 formed
3
4135
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?
4
1426
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 to my Web Site and type in the URL: : http://www.certify-it.com/Test/test1.aspx , it give me the
27
5133
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
12
3398
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 made this simple program which (from what I understand) does not seem to be working as expected in all...
18
2833
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. ======================= /*EXAMPLE 1*/ /*index.php*/
7
2846
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 directory uniformly. I'm keeping a meta data in a file where I'm keeping the track of file parse...
3
18982
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>
0
1417
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??
0
8709
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8638
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9202
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8952
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7791
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5894
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4395
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4649
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2371
muto222
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.