Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^4: Reading XML LibXML

by McA (Priest)
on Oct 02, 2013 at 11:07 UTC ( #1056599=note: print w/replies, xml ) Need Help??

in reply to Re^3: Reading XML LibXML
in thread Reading XML LibXML

...which dies horribly when there is only one <Entry>-element, e.g. the following XML:

<table> <Entry No="1"> <lastname_>Dasd</lastname_> <firstname_>Dasd</firstname_> <street_>Dasd</street_> <houseno_>12</houseno_> <zip_>1231</zip_> <city_>Dasd</city_> <sex_>maennlich</sex_> <marital_>geschieden</marital_> <character_>Brille Sommersprossen</character_> <description_>asdas </description_> </Entry> </table>

Which prooves what Anonymous monk said before... ;)


Replies are listed 'Best First'.
Re^5: Reading XML LibXML
by hdb (Monsignor) on Oct 02, 2013 at 11:11 UTC

    True, but why would you write a script for a single record? ;)

      Probably a script fetching external xml-files, where you get 0-n <Entry>-tags in each file... ;)

        I agree with the statement about the limitations of XML::Simple. I like it a lot as it can solve simple problems with three lines of code, and I find it acceptable to use the one or other option as well (say ForceArray), but once you reach that point, a more powerful module is usually required.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056599]
[Discipulus]: mmh.. if I say say for glob '{0-0}|{1-0,1-1}|{ 2-1,2-2}|3-2' I obtain what I expected, but no if I put a space instead of pipes.. why?
[choroba]: spaces have special meaning in glob
[choroba]: backslashing them should help
Discipulus ...Note that glob splits its arguments on whitespace..
[Discipulus]: oh it passed also some days ago iirc
[Discipulus]: thanks

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-03-20 11:57 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (250 votes). Check out past polls.