This module is used to transform Marc XML from Aleph to MODS used by LTP’s SIP package.
Convert OAI to MARC XML.
Parameters: | marc_oai (str) – String with either OAI or MARC XML. |
---|---|
Returns: | str – String with MARC XML. |
Add proper XML namespace to the marc_xml record.
Parameters: | marc_xml (str) – String representation of the XML record. |
---|---|
Returns: | str – XML with namespace. |
Read MARC XML or OAI file, convert, add namespace and return XML in required format with all necessities.
Parameters: | xml (str) – Filename or XML string. Don’t use \n in case of filename. |
---|---|
Returns: | obj – Required XML parsed with lxml.etree. |
Read XSLT template.
Parameters: | template (str) – Filename or XML string. Don’t use \n in case of filename. |
---|---|
Returns: | obj – Required XML parsed with lxml.etree. |
Transform xml using XSLT template.
Parameters: |
|
---|---|
Returns: | str – Transformed xml as string. |
Convert marc_xml to MODS data format.
Parameters: | marc_xml (str) – Filename or XML string. Don’t use \n in case of filename. |
---|---|
Returns: | str – Transformed xml as string. |