Mandor has asked for the wisdom of the Perl Monks concerning the following question:

I am currently trying to pregenerate a relatively large
amount (200) of HTML files from a XML file.
But I stumbled over a problem with special chars. The XML
file contains german special chars and the resulting
HTML files need to contain these chars too.
When parsing the XML File (with XML::Simple) and
generating the output (with HTML::Template) I ran into
the problem that the HTML source contained the special
chars and these were not shown correctly when rendered by the browser.

So I decided to to change all the special chars to their
unicode counterparts (ü, ä, ö, Ü, Ä, Ö)
in the XML file. But now my script
seems to be stumbling over the unicode special chars.

I get the following error message with my altered XML
file :

undefined entity at line 6, column 79, byte 500 at
C:/Perl/site/lib/XML/Parser.p m line 168

I am thankful for any suggestions.

Replies are listed 'Best First'.
Re: Parsing special chars from a XML file
by jaldhar (Vicar) on Dec 09, 2001 at 04:28 UTC

    use the HTML::Entities module to convert special characters to an XML/HTML friendly form.