Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: XML::Parser error

by runrig (Abbot)
on Sep 11, 2013 at 18:23 UTC ( #1053546=note: print w/ replies, xml ) Need Help??


in reply to XML::Parser error

The char handler does not necessarily return all of the contiguous char data in one go. From the docs:
Char (Expat, String) This event is generated when non-markup is recognized. The non-markup sequence of characters is in String. A single non-markup sequence of characters may generate multiple calls to this handler. Whatever the encoding of the string in the original document, this is given to the handler in UTF-8.
So you will have to concatenate the char data yourself. That said, I would likely use some higher level library rather than use XML::Parser directly, then you very likely wouldn't have to do the concatenating yourself.

Replies are listed 'Best First'.
Re^2: XML::Parser error
by mwinterer (Initiate) on Sep 11, 2013 at 21:50 UTC

    Thanks. That helped how to fix for now. Any suggestions on what higher level module would be good to use? Basically I am parsing XML files delivered every 15 minutes to my server to parse and load into the DB. I looked around when developing and didn't really see anything that would fit that. Maybe I didn't look hard enough though.

      I'm partial to XML::Rules. Others like XML::Twig. Either is good if the docs are large and you should be processing the doc as you read it. XML::LibXML can be appropriate also (XPath support is great if you need that sort of thing).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2016-06-25 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (325 votes). Check out past polls.