|
|
XML::Simple Parsing with Attributes problem #2
Hi - problem parsing with an attribute name.
<england>
<town code="LON">Capital City</town>
<town code="MAN">Manchester</town>
<town code="BHAM">Birmingham</town>
</england>
I'm using XML::Simple.
$xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
$data = $xml->XMLin($xmlfile);
$which=$data->{england}->[0]->{town}->[0]; doesn't work.
I need to access both attribute value and its contents (BHAM and
Birmingham).
Any ideas?
John
|
|
0
|
|
|
|
Reply
|
John
|
2/3/2006 11:39:34 AM |
|
"John" <john@heathdrive.com> wrote:
> Hi - problem parsing with an attribute name.
>
> <england>
> <town code="LON">Capital City</town>
> <town code="MAN">Manchester</town>
> <town code="BHAM">Birmingham</town>
> </england>
>
> I'm using XML::Simple.
>
> $xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
> $data = $xml->XMLin($xmlfile);
>
> $which=$data->{england}->[0]->{town}->[0]; doesn't work.
>
> I need to access both attribute value and its contents (BHAM and
> Birmingham).
>
> Any ideas?
use Data::Dumper;
print Dumper $data;
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
|
|
0
|
|
|
|
Reply
|
xhoster
|
2/3/2006 4:39:34 PM
|
|
|
1 Replies
79 Views
(page loaded in 0.049 seconds)
Similiar Articles: quick problem - parsing text, calculation function... - comp ...Fast XML reader? - comp.soft-sys.matlab quick problem - parsing text, calculation function ... Hi, I am using gawk for text parsing. Now I have a simple problem. Simple XML processing in AWK - comp.lang.awk... about doing some simple XML ... matter) to do serious parsing and processing of XML ... awk - comp.lang.awk Simple XML processing in AWK - comp.lang.awk XML tag attribute ... XML-Parsing with UTF-8 Byte-Order-Mark (BOM) - comp.lang.java ...Hello, i have a really weird problem. The ... --- Now i have to parse the xml to find a node-attribute and decide upon ... Save file defaults to utf-16 - comp.emacs XML-Parsing ... parsing a text file - comp.soft-sys.matlabParsing XML with Filemaker Server 7 and XSLT, problem ... Simple XML processing in AWK - comp.lang.awk parsing a text file - comp.soft-sys.matlab... tag attribute ... parsing XML file with sed - comp.unix.shellusing awk to modify xml file - comp.lang.awk Simple XML processing in AWK - comp.lang.awk parsing a text file - comp.soft-sys.matlab... tag attribute ... Simple parsing text , but not for newbie - comp.lang.awk ...Hi, I am using gawk for text parsing. Now I have a simple problem. I have a string looking like this ... Encrypt And Decrypt A Simple Text File ( I Am A Newbie) Parse XML ... [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ... - comp ...... anything at that URL that would be the problem, but as is, there is a WSDL XML ... exception: [WSDL] SOAP-ERROR: Parsing > WSDL ... Denial - It's Simple Object Access Protocol using awk to modify xml file - comp.lang.awk... was wondering whether this problem ... comp.soft-sys.matlab... tag attribute extraction using awk - comp.lang.awk parsing XML ... Parsing Text Files - How to parse simple ... How to search for a node in an XML-document the easiest way ...If somebody would have a simple example of an XML ... XML-Parsing with UTF-8 Byte-Order-Mark ... parse the xml to find a node-attribute ... how Castor is -- choosing his XML ... Parsing Log records with regular expressions - comp.lang.ruby ...Hi, I am using gawk for text parsing. Now I have a simple problem. I have a string looking like ... Comment on XML parsing vs Regular expressions Re: XML parsing vs Regular ... XML Parsing Failed | eHow.comXML Parsing Failed. Markup languages such as XML are notoriously easy ... problems processing the data appearing later in the XML ... XML element attributes may cause parsing ... CXMLFile - A Simple C++ XML Parser - CodeProjectAn article on simple and fast C++ XML parser; Author ... is, however, a COM alternative for XML file parsing ... A simple ATTRIBUTE element, like Attribute="Value" 7/24/2012 3:16:23 AM
|
|
|
|
|
|
|
|
|