develooper Front page | perl.perl4lib | Postings from June 2008

Re: Can't parse MARC Authority XML files with mx: prefixes in their tags

Thread Previous | Thread Next
From:
Mike Rylander
Date:
June 12, 2008 06:54
Subject:
Re: Can't parse MARC Authority XML files with mx: prefixes in their tags
On Tue, Jun 10, 2008 at 1:18 PM, Christopher Morgan <morgan@acm.org> wrote:
> Mike,
>
> Sorry. Since my last post, I did find out how to use the UNIX patch command,
> and applied your patch to SAX.pm. My script still doesn't work, and there
> are no error messages. My earlier script (which worked on the subject
> authority file) now does not work, so I'm wondering if something in the
> patch may be causing this. I have a backup of the SAX.pm file in any case.
>

Well, it turns out I left something out of the patch I sent before.
In the end_element sub, the second line should be

    my $name = $element->{ LocalName };

instead of

    my $name = $element->{ Name };

If you would, you can just edit the installed version of the patched
SAX.pm to test.

The next thing to try would be to remove the namespace test, but leave
the LocalName changes in place.  Anecdotal evidence suggests that some
of the more popular XML parsing engines, or at least the Perl bindings
for them, have problems with namespaces.  I've attached a (complete,
arg!) patch that implements just the LocalName changes and would be
applied to the original version of SAX.pm.

If you don't have time to test all this that's fined, but if not would
you be willing to send a couple of your problem records?

Thanks Christopher,

-- 
Mike Rylander
 | VP, Research and Design
 | Equinox Software, Inc. / The Evergreen Experts
 | phone: 1-877-OPEN-ILS (673-6457)
 | email: miker@esilibrary.com
 | web: http://www.esilibrary.com


Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About