diff --git a/articlemeta/export_crossref.py b/articlemeta/export_crossref.py
index 96d23e4..2b42322 100644
--- a/articlemeta/export_crossref.py
+++ b/articlemeta/export_crossref.py
@@ -893,17 +893,19 @@ class XMLCitation(object):
         def precond(data):
             raw, xml = data
 
-            if not raw.date:
+            if not raw.publication_date:
                 raise plumber.UnmetPrecondition()
 
         @plumber.precondition(precond)
         def transform(self, data):
             raw, xml = data
 
-            pdate = ET.Element('cYear')
-            pdate.text = raw.date[0:4]
+            year = raw.publication_date[0:4]
 
-            xml.find('.').append(pdate)
+            if len(year) > 0 and year.isdigit() and int(year) > 0:
+                pdate = ET.Element("cYear")
+                pdate.text = year
+                xml.find(".").append(pdate)
 
             return data
 

[scieloci] Erro em data de publicação de 
### Descrição do problema

http://articlemeta.scielo.org/api/v1/article/?collection=scl&code=S0001-37652008000100006&format=xmlwos

Gerou year com valor 0000.

```xml
<ref id="B25"><element-citation publication-type="conference"><conf-name>Seminário Internacional de Manejoem Floresta Tropical-SEMA/WWF</conf-name><conf-loc>Serra dos Carajás</conf-loc><source>Presentation</source><date><day>29</day><month>01</month><year>0000</year></date><person-group><name><surname>FEARNSIDE</surname><given-names>PM</given-names></name></person-group></element-citation></ref>
```

No entanto, no registro há a data correta, no campo v64. O correto é usar `raw.publication_date` no lugar de `raw.date` entrega a data de acordo com o tipo de referência bibliográfica, ou seja, se é tese, a data da tese, se é link, a data do acesso, e assim por diante. No entanto, a data que interessa na referência bibliográfica é a data de publicação do documento.

https://github.com/scieloorg/articles_meta/blob/05743b335f07dd97b828c375c5240e2833e58657/articlemeta/export_sci.py#L230


diff --git a/tests/test_export_crossref.py b/tests/test_export_crossref.py
index 8577cf9..47eda9f 100644
--- a/tests/test_export_crossref.py
+++ b/tests/test_export_crossref.py
@@ -608,6 +608,37 @@ class ExportCrossRef_one_DOI_only_Tests(unittest.TestCase):
             self.assertIsNotNone(programs)
 
 
+    def test_date_pipe_should_includes_year_when_it_is_valid(self):
+        doi_batch = create_xmlcrossref_with_n_journal_article_element(["pt"])
+        self._raw_json["citations"] = [{"v65": [{"_": "20060320"}]}]
+        article_json = Article(self._raw_json)
+        data = [article_json, doi_batch]
+
+        xmlcrossref = export_crossref.XMLArticleCitationsPipe()
+        raw, xml = xmlcrossref.transform(data)
+
+        self.assertIsNotNone(xml.find(".//citation"))  # ensure citation
+
+        expected_c_year = xml.find(".//cYear")
+
+        self.assertIsNotNone(expected_c_year)
+        self.assertEqual(u"2006", expected_c_year.text)
+
+    def test_date_pipe_should_not_includes_year_when_it_is_zero(self):
+        doi_batch = create_xmlcrossref_with_n_journal_article_element(["pt"])
+        self._raw_json["citations"] = [{"v65": [{"_": "0000"}]}]
+        article_json = Article(self._raw_json)
+        data = [article_json, doi_batch]
+
+        xmlcrossref = export_crossref.XMLArticleCitationsPipe()
+        raw, xml = xmlcrossref.transform(data)
+
+        self.assertIsNotNone(xml.find(".//citation"))  # ensure citation
+
+        not_expected_c_year = xml.find(".//cYear")
+
+        self.assertIsNone(not_expected_c_year)
+
 class ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests(unittest.TestCase):
 
     def setUp(self):

pip install -e .
parse_log_pytest
requirements.txt
mocker nose coverage mongomock pytest
apt-get update apt-get install -y gcc libxml2-dev libxslt-dev git musl-dev
3.5.2
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/scieloorg/articles_meta.git@d5a36056f2369afbd4038eca3a9ab537514731c3#egg=articlemeta
attrs==22.2.0
certifi==2018.1.18
chardet==3.0.4
coverage==6.2
crossrefapi==1.3.0
hupper==1.0
idna==2.6
importlib-metadata==4.8.3
iniconfig==1.1.1
legendarium==2.0.2
lxml==4.1.1
mocker==1.1.1
mongomock==4.3.0
nose==1.3.7
packaging==21.3
PasteDeploy==1.5.2
picles.plumber==0.11
plaster==1.0
plaster-pastedeploy==0.4.2
pluggy==1.0.0
ply==3.10
py==1.11.0
pymongo==3.6.1
pyparsing==3.1.4
pyramid==1.9.1
pytest==7.0.1
pytz==2025.2
raven==6.5.0
repoze.lru==0.7
requests==2.18.4
sentinels==1.0.0
thriftpy==0.3.9
-e git+https://github.com/scieloorg/thriftpy-wrap@00e4c3ea4f20bfb2414eef7690d769bde308c0a4#egg=thriftpywrap
tomli==1.2.3
translationstring==1.4
typing_extensions==4.1.1
urllib3==1.22
venusian==1.1.0
WebOb==1.8.0rc1
-e git+https://github.com/scieloorg/xylose.git@56ea916556da5fd743b2c2105247d98a72c79314#egg=xylose
zipp==3.6.0
zope.deprecation==4.3.0
zope.interface==4.4.3

name: articles_meta
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - certifi==2018.1.18
      - chardet==3.0.4
      - coverage==6.2
      - crossrefapi==1.3.0
      - hupper==1.0
      - idna==2.6
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - legendarium==2.0.2
      - lxml==4.1.1
      - mocker==1.1.1
      - mongomock==4.3.0
      - nose==1.3.7
      - packaging==21.3
      - pastedeploy==1.5.2
      - picles-plumber==0.11
      - plaster==1.0
      - plaster-pastedeploy==0.4.2
      - pluggy==1.0.0
      - ply==3.10
      - py==1.11.0
      - pymongo==3.6.1
      - pyparsing==3.1.4
      - pyramid==1.9.1
      - pytest==7.0.1
      - pytz==2025.2
      - raven==6.5.0
      - repoze-lru==0.7
      - requests==2.18.4
      - sentinels==1.0.0
      - thriftpy==0.3.9
      - tomli==1.2.3
      - translationstring==1.4
      - typing-extensions==4.1.1
      - urllib3==1.22
      - venusian==1.1.0
      - webob==1.8.0rc1
      - zipp==3.6.0
      - zope-deprecation==4.3.0
      - zope-interface==4.4.3
prefix: /opt/conda/envs/articles_meta

tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_date_pipe_should_not_includes_year_when_it_is_zero
tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_abbreviated_journal_title_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_contributors_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_pages_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_pid_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_publication_date_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_title_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_article_titles_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_body_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_date_pipe_should_includes_year_when_it_is_valid tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_depositor_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_doi_batch_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_doi_batch_id_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_elocation_id_pipeline_should_create_publisher_item tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_every_journal_article_must_contain_own_license tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_head_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_article_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_article_should_contain_item_number_with_elocation_id tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_article_should_not_contain_licenses tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_article_should_not_contains_publisher_item_and_item_number tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_issn_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_issue_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_metadata_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_journal_title_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_number_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_publication_date_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_registrant_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_time_stamp_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_validating_against_schema tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_volume_element tests/test_export_crossref.py::ExportCrossRef_one_DOI_only_Tests::test_xmlclose_pipe tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_abstracts_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_contributors_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_pages_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_pid_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_publication_date_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_title_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_article_titles_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_citations_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_collection_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_doi_data_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_doi_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_every_journal_article_must_contain_own_license tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_journal_article_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_journal_article_should_not_contain_licenses tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_related_item_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_MultipleDOI_Tests::test_resource_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_abstracts_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_contributors_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_pages_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_pid_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_publication_date_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_title_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_article_titles_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_citations_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_collection_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_doi_data_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_doi_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_journal_article_element tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_related_item_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_MultiLingueDoc_with_DOI_pt_es_Tests::test_resource_elem_for_multilingue_document tests/test_export_crossref.py::ExportCrossRef_XMLArticlePubDatePipe_Tests::test_article_publication_date_element_aop_article tests/test_export_crossref.py::ExportCrossRef_XMLArticlePubDatePipe_Tests::test_article_publication_date_element_continuospub_article tests/test_export_crossref.py::ExportCrossRef_XMLArticlePubDatePipe_Tests::test_article_publication_date_element_issue_article tests/test_export_crossref.py::ExportCrossRef_XMLIssuePipe_Tests::test_aop_element tests/test_export_crossref.py::ExportCrossRef_XMLIssuePipe_Tests::test_issue_element tests/test_export_crossref.py::ExportCrossRef_XMLVolumePipe_Tests::test_aop_element
articlemeta/export_crossref.py
articlemeta/export_crossref.py