Skip to content

Commit

Permalink
Merge pull request #204 from szymonlopaciuk/edp_remove_ref_xmlns
Browse files Browse the repository at this point in the history
jats: scrapy handles removing namespaces now
  • Loading branch information
michamos authored Jan 8, 2018
2 parents 269bc8e + 55f2f7e commit 8514ac8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions hepcrawl/parsers/jats.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from inspire_utils.date import PartialDate
from inspire_utils.helpers import maybe_int, remove_tags

from lxml import etree # needed until a new release of parsel is made

from ..utils import get_first, get_node


Expand Down Expand Up @@ -459,7 +457,6 @@ def get_root_node(jats_record):
else:
root = jats_record
root.remove_namespaces()
etree.cleanup_namespaces(root.root)

return root

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_edp.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def test_references(record_references_only):
'journal_title': u'J. Nucl. Radiochem. Sci.',
'journal_volume': u'10',
'number': u'5a',
'raw_reference': u'<mixed-citation xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" publication-type="journal" id="a"><string-name><given-names>R.V.</given-names> <surname>Krishnan</surname></string-name>, <string-name><given-names>G.</given-names> <surname>Panneerselvam</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Manikandan</surname></string-name> <string-name><given-names>M.P.</given-names> <surname>Antony</surname></string-name>, <string-name><given-names>K.</given-names> <surname>Nagarajan</surname></string-name>, <source>J. Nucl. Radiochem. Sci.</source>, <volume>10</volume>.<issue>1</issue>, <fpage>19</fpage>\u2013<lpage>26</lpage> (<year>2009</year>).</mixed-citation>',
'raw_reference': u'<mixed-citation publication-type="journal" id="a"><string-name><given-names>R.V.</given-names> <surname>Krishnan</surname></string-name>, <string-name><given-names>G.</given-names> <surname>Panneerselvam</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Manikandan</surname></string-name> <string-name><given-names>M.P.</given-names> <surname>Antony</surname></string-name>, <string-name><given-names>K.</given-names> <surname>Nagarajan</surname></string-name>, <source>J. Nucl. Radiochem. Sci.</source>, <volume>10</volume>.<issue>1</issue>, <fpage>19</fpage>\u2013<lpage>26</lpage> (<year>2009</year>).</mixed-citation>',
'year': u'2009'
}

Expand Down

0 comments on commit 8514ac8

Please sign in to comment.