Using XML and XSL to transform and import records

by Jonathan Jacobsen Wednesday, July 29, 2009 6:53 PM

Why enter records into your database when you can have someone else do it for you? Or at least, why not borrow records from other sources and import them into your database? It’s quite easy to do, saving time and improving accuracy. One approach to this is:

  1. Use a service such as Bookwhere, Biblios.net or PubMed to search for records in numerous online databases, for materials such as books, journals, articles, videos, maps ­- anything that might have been catalogued by someone somewhere may be found (see our blog post on Biblios.net).
  2. Save records in MARC XML format (though any XML format can be used).
  3. In Genie (part of the Inmagic Library Suite), use the included Bookwhere XSLT to convert selected MARC tags to Genie fields and import records. (XSLT is short for Extensible Stylesheet Language Transformation, and is a language used to transform XML data into other formats).
  4. In Inmagic DB/Text, customize an XSLT to map MARC XML or any other XML data source to your data structure and import records.
  5. After importing records, you would of course further customize them to suit your database.

If you use Genie, it includes an XSLT (Bookwhere.xsl in the Genie ImporterFiles folder) that maps MARC XML fields into Genie fields. You can customize this XSLT further for your cataloging needs. For example, some MARC tag to Genie field mappings we have added include:

 

MARC Tags Genie Field
090 or 050 CatCallNumber
520 CatAbstract

856 subfield u

CatURL

856 subfield y

CarURLNotes

246, 247, 730, 740, 770, 772, 776, 780, 785, 787

CatAlternateTitle

Leader position 6 or 7

CatRecordType

Here's an example of the above Leader mapping added to the Genie Bookwhere.xsl transformation:

<xsl:template name="RecordType2" match="marc:leader">

<xsl:choose>

<xsl:when test="substring(marc:leader, 8, 1 )='s'">

'CatRecordType' Periodical

</xsl:when>

<xsl:when test="substring(marc:leader, 7, 1 )='a'">

'CatRecordType' Book

</xsl:when>

<xsl:when test="substring(marc:leader, 7, 1 )='g'">

'CatRecordType' Videorecording

</xsl:when>

</xsl:choose>

</xsl:template>

Virtually any XML file can be imported into a textbase using an XSL. The beauty of XSLT is that data cleanup can be done as part of the process. For example, ALL CAPS can be converted to Title case, fields can be separated or joined, dates can be transformed to other formats, and much more.

Andornot Starter Kit revamp with Google Book Covers

by Administrator Tuesday, July 07, 2009 10:59 PM
We've been doing renovations - raising the roof, adding re-bar to the foundations and while we are at it, we added a sundeck. What has this got to do with databases you ask? Well - at least in a metaphorical way - we think it does. One of Andornot's strengths is our ability to integrate a database into a website. To continue to do that - which by the way, we think is essential - we had to change a few areas of our base add-on product called ASK.

A bit of history

ASK - short for Andornot Starter Kit - started off as a desktop add-on for Inmagic DB/TextWorks, with a nice looking search page, a few well designed search results reports, a full display form and a fully functional data entry form for a typical catalogue database. This was mostly to help us quickly get a client's database up and running quickly and beautifully. I mean why keep re-inventing the wheel? We added a menu screen and navigational script buttons to each query screen and form to ease repetitive tasks. We eventually added a web search screen and a few web forms to work with Inmagic WebPublisher Pro. In due course we thought that we should have all of this on our website so we could showcase many of the bells and whistles that we have developed over the years. We set-up http://ask.andornot.com using the "include" file method that was added as of Inmagic WebPublisher version 8 with lots to show off.

And so it grows

We used the site as a vehicle for our search and results scripts (including several versions over time - adding revise search, URL Tamer, and AutoBoolean), our Email, Save and Print add-on, our Ordering cart add-on and canned searches. We used this product as a basis for many a fine looking site. But then we became restless - we wanted to add more, we wanted to change the undercarriage. We wanted to make it even better!

The renovations

The "include" files were frustrating our staff. While they were a good and simple solution, we wanted to have something more robust; something easier to maintain. As it turned out we had that in another format. We converted the includes to ASP.NET Master Pages and used our webpub results control, which our late great developer Nathan Mayr was instrumental in creating and which we previously only implemented for our high-end clients. It was time to share it with everyone.

The extras

So once we got the groundwork redone, we added the extras. Based on user requests, we had wanted to add book covers for a while, but what with copyright issues always at the door, we hesitated, but then Google Books with cover images rose to the fore. Imagine every book in your catalogue having a nice book cover image in the record and a link to preview the book all through a bit of code around the ISBN number. Note that if there is no matching ISBN at Google Books, nothing shows. The amount of information available at Google Books varies widely - see the title Knowledge and Strategy for a book that has a detailed Preview with table of contents and selected pages. A great way of letting your users evaluate a title better! Check out the canned search Example of Book Covers from Google... we have added the sundeck to the site.

The future

Who knows what more we can add to this already pretty groovy set of features and functions. Tell us what you would like. You are our lifeblood: we listen to our clients. Go to http://ask.andornot.com and be part of the next reno - we are thinking about a turret or a wine cellar or a bay-window.

Inmagic DB/TextWorks v12 released

by Administrator Thursday, July 02, 2009 10:23 AM

Inmagic has announced the release of DB/TextWorks version 12.

New and enhanced features include:

Improvements to batch modify, validation lists, and import functionality:

  • Batch modify to change more than one field at a time.
  • Batch modify field-to-field: Copy or move the contents of one field to another.
  • Update records to match validation list changes: When terms on a validation list are changed or deleted, corresponding changes can be made in affected textbase records.
  • Option to update multiple matching records when importing.

Enhanced search capabilities:

  • Thesaurus expansion when searching: Optional retrieval of preferred and related terms when searching fields connected to a thesaurus.

Enhanced E-mail options:

  • E-mail reports in HTML: Send Report as Mail now supports HTML format in the e-mail body.
  • E-mail reports grouped by recipient: E-mail reports sent to recipients identified in textbase records can optionally have all messages to a given recipient grouped into one e-mail message.

Advanced imaging. Capabilities support newer image formats, with:

  • Support for the latest version of PDF formats from Adobe® Acrobat® when treating the PDF file as an image field.

All clients with a current Inmagic maintenance subscription for DB/TextWorks should shortly receive an email from Inmagic with the download information for this new version. No date has yet been announced for the release of CS/TextWorks v12.   If you have a current subscription but have not received a notification email in the next week or so, please email advantage@inmagic.com with your serial number and email address so it can be resent.  Please also remember to let us know if your contact information has changed so we can update our records and pass this on to Inmagic. 

Please contact us if you would like assistance implementing these new features or want to renew an expired maintenance subscription.

Month List