From: Dave B. <dav...@al...> - 2008-12-11 03:29:54
Attachments:
modsxml.diff.gz
|
Hi, includes/modsxml.inc.php splits fields on semicolon after encoding XML entities. If a keywords field contains "a topic with an ampersand & in it", the resultant XML will split the topic, breaking the XML entity and making the document invalid: <subject><topic>a topic with an ampersand &</topic></subject> <subject><topic>in it</topic></subject> The attached patch reverses the order of these two transformations by moving the pre-processing loop over $row to a function encodeField(value) that is applied just before putting field values into the XML object. Cheers, Dave Burt |
From: Matthias S. <re...@ex...> - 2008-12-11 15:03:12
|
Hi Dave, thanks for the clear bug report and the patch! On 11-Dec-08 at 14:25 +1100 Dave Burt wrote: > includes/modsxml.inc.php splits fields on semicolon after encoding > XML entities. uugh, yes, good catch! > The attached patch reverses the order of these two transformations > by moving the pre-processing loop over $row to a function > encodeField(value) that is applied just before putting field values > into the XML object. Looks good. I'll integrate your patch into the refbase SVN (bleeding-edge) version, as soon as I can. Thanks again for the report, Matthias |
From: Matthias S. <re...@ex...> - 2008-12-13 19:32:07
|
Hi Dave, I've now commited your changes to the bleeding-edge branch of the refbase SVN repository: <http://refbase.svn.sourceforge.net/viewvc/refbase/branches/bleeding-edge/includes/modsxml.inc.php?view=log> This fix also includes some improvements to the handling of initials/forenames. Thanks again for reporting the issue and for submitting patches, Matthias On Thu, 11-Dec-2008 14:25 +1100, Dave Burt wrote: > If a keywords field contains "a topic with an ampersand & in it", > the resultant XML will split the topic, breaking the XML entity and > making the document invalid: > > <subject><topic>a topic with an ampersand &</topic></subject> > <subject><topic>in it</topic></subject> > > The attached patch reverses the order of these two transformations > by moving the pre-processing loop over $row to a function > encodeField(value) that is applied just before putting field values > into the XML object. |