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

Re: Perl code for XML/HTML entities:

by Anonymous Monk
on Jul 18, 2013 at 14:59 UTC ( [id://1045119]=note: print w/replies, xml ) Need Help??


in reply to Perl code for XML/HTML entities:

And the question is?

Replies are listed 'Best First'.
Re^2: Perl code for XML/HTML entities:
by Narend (Initiate) on Jul 18, 2013 at 15:25 UTC
    as stated "registered symbol breaks the parsing. " So if the parsing does not happen, need to fix that and I have tried HTML::Entities::numeric, but that converts everything to numeric equi, so that does not help. Therefore the question is how to read an XML as string to be fed to create my xpath object, where there are symbols in the String ? Thanks.

      This is most likely an encoding problem.

      Find out which encoding the data is in, and either declare the encoding at the top of the XML file using an XML declaration, or convert the data to UTF-8 before feeding it to the parser.

      If you're in the US/UK, the encoding is probably ISO-8859-1 (or ISO-8859-15 if the data includes the euro symbol).

        Thanks mirod, for pointing out. Yes, I did use the xml feed encoding as <?xml version="1.0" encoding="ISO-8859-1"?>. That throws interesting challenge. [XxXXXxx® II xxxxxx xxxxxxxxxx xxx but fails for XxXXXxx® 77 xxxxxx xxxxxxxxxx xxx So if there are numbers after the symbol it does not recognize now. If it is chars, seems to understand that. Any further pointers pls ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-24 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found