Skip to content

Commit

Permalink
fix: Fix multi values in some attributes in PubMedBookArticle (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab authored Feb 19, 2025
1 parent 5e2814d commit 72d2f74
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pymedx/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(
self.__setattr__(field, kwargs.get(field, None))

def _extractPubMedId(self: object, xml_element: _Element) -> Optional[str]:
path = ".//ArticleId[@IdType='pubmed']"
path = ".//BookDocument/PMID"
return getContent(element=xml_element, path=path)

def _extractTitle(self: object, xml_element: _Element) -> Optional[str]:
Expand All @@ -71,7 +71,7 @@ def _extractCopyrights(
return getContent(element=xml_element, path=path)

def _extractDoi(self: object, xml_element: _Element) -> Optional[str]:
path = ".//ArticleId[@IdType='doi']"
path = ".//BookDocument/ArticleIdList/ArticleId[@IdType='doi']"
return getContent(element=xml_element, path=path)

def _extractIsbn(self: object, xml_element: _Element) -> Optional[str]:
Expand Down
Loading

0 comments on commit 72d2f74

Please sign in to comment.