[Mediawiki-l] xml import parse error on plusmn entity
jimhu at tamu.edu
Mon Jun 23 15:52:56 UTC 2008
On Jun 20, 2008, at 1:15 PM, Brion Vibber wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Jim Hu wrote:
>> I'm thinking this may be a php bug rather than a mw problem - but I'm
>> wondering how to get around it. I generate MW xml for importing
>> and I use htmlentities to encode things for xml. But I just saw a
>> problem with the XML parser failing to recognize the ± entity.
> ± has no inherent meaning in XML; it would have to be defined
> the doctype or directly in a processor directive in the document.
> Instead of htmlentities(), use htmlspecialchars() which is safe for
> by only using the XML-predefined character references &, <,
> and ".
Done! I also did something I should have done before I posted - I put
a ± in a Sandbox page and exported it to see how MW handles
it... it turns into a &plusmn, which imports and converts back to
the plus or minus character. Nice!
> Ensure your text is properly encoded (eg, UTF-8 unless your XML file
> otherwise marked.)
> - -- brion
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> -----END PGP SIGNATURE-----
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
Dept. of Biochemistry and Biophysics
Texas A&M Univ.
College Station, TX 77843-2128
More information about the MediaWiki-l