Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Problem reading sign with XML::Simple

by pelagic (Curate)
on Apr 27, 2005 at 09:46 UTC ( #451880=note: print w/ replies, xml ) Need Help??

in reply to Problem reading sign with XML::Simple

Have you got a XML Declaration line in your XML document like:
<?xml version="1.0" encoding="ISO-8859-1"?>
where you could define the appropriate encoding for or what not?

I was obviously late :p


Comment on Re: Problem reading sign with XML::Simple
Download Code
Replies are listed 'Best First'.
Re^2: Problem reading sign with XML::Simple
by gothic_mallard (Pilgrim) on Apr 27, 2005 at 10:01 UTC

    Actually I've tried it a few ways:

    • Explicitly including in the source document
    • Manually appending it as the data is read
    • Using the options in XML::Parser to force an encoding

    The file did initially come without declarations. The structure itself is a single file with a header and footer lines where each line in between is a distinct XML document (newline delimited obviously).
    The program reads through one line at a time and feeds these lines individually to XML::Simple, where it parses them and outputs the relevant values before discarding the data and reading the next. e.g.

    HEADER0002 <?xml .. ?><document><colour>red</colour><cost>10</cost></document> <?xml .. ?><document><colour>blue</colour><cost>14</cost></document> .... .... etc FOOTER0002

    --- Jay

    All code is untested unless otherwise stated.
    All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
    If in doubt ask.

    s++blah+;y(bl) .j.s;s+(h)+p$1+;???print:??;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://451880]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2015-11-26 18:18 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (705 votes), past polls