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: | String with MARC XML. |
Return type: | str |
Add proper XML namespace to the marc_xml record.
Parameters: | marc_xml (str) – String representation of the XML record. |
---|---|
Returns: | XML with namespace. |
Return type: | str |
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: | Required XML parsed with lxml.etree. |
Return type: | obj |
Read XSLT template.
Parameters: | template (str) – Filename or XML string. Don’t use \n in case of filename. |
---|---|
Returns: | Required XML parsed with lxml.etree. |
Return type: | obj |
Transform xml using XSLT template.
Parameters: | |
---|---|
Returns: | Transformed xml as string. |
Return type: | str |