Skip to content

Instantly share code, notes, and snippets.

@rosiel
Last active March 28, 2018 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosiel/7bd7caafe13f84e1357eaee17e84a245 to your computer and use it in GitHub Desktop.
Save rosiel/7bd7caafe13f84e1357eaee17e84a245 to your computer and use it in GitHub Desktop.
XPATH snippet to extract MODS title and apply ISBD punctuation
string-join(
(
string-join(
(
string-join(
(
/mods/titleInfo[not(@type)]/nonSort/text(),
/mods/titleInfo[not(@type)]/title/text()
),
' '
),
/mods/titleInfo[not(@type)]/subTitle/text()
),
' : '
),
string-join(
(
/mods/titleInfo[not(@type)]/partNumber/text(),
/mods/titleInfo[not(@type)]/partName/text()
),
', '
)
),
'. '
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment