Last active
February 5, 2019 12:45
-
-
Save kschlottmann/1a21c9c6587ef4d81e34970087db7691 to your computer and use it in GitHub Desktop.
xquery to find EAD did elements without unittitle or unitdate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <data> | |
| { | |
| for $Record in /ead | |
| where $Record/archdesc/dsc//did/unitdate[not(normalize-space(.))] | |
| let $id := $Record/archdesc/did/unitid[@type='clio']/text() | |
| let $repo := $Record/archdesc/did/unitid[1]/@repositorycode | |
| let $didEmptyTitle := $Record/archdesc/dsc//did/unitdate[not(normalize-space(.))] | |
| return | |
| <record> | |
| <id>{$id}</id> | |
| <repo>{data($repo)}</repo> | |
| <u>{$didEmptyTitle}</u> | |
| </record> | |
| } | |
| </data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <data> | |
| { | |
| for $Record in /ead | |
| where $Record/archdesc/dsc//did/unittitle[not(normalize-space(.))] | |
| let $id := $Record/archdesc/did/unitid[@type='clio']/text() | |
| let $repo := $Record/archdesc/did/unitid[1]/@repositorycode | |
| let $didEmptyTitle := $Record/archdesc/dsc//did/unittitle[not(normalize-space(.))] | |
| return | |
| <record> | |
| <id>{$id}</id> | |
| <repo>{data($repo)}</repo> | |
| <u>{$didEmptyTitle}</u> | |
| </record> | |
| } | |
| </data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <data> | |
| { | |
| for $Record in /ead | |
| where $Record//dsc//did[(not(unittitle) and not(unitdate))] | |
| let $id := $Record/archdesc/did/unitid[@type='clio']/text() | |
| let $repo := $Record/archdesc/did/unitid[1]/@repositorycode | |
| let $didNoTitleDate := $Record/archdesc/dsc//did[(not(unittitle) and not(unitdate))] | |
| return | |
| <record> | |
| <id>{$id}</id> | |
| <repo>{data($repo)}</repo> | |
| <u>{$didNoTitleDate}</u> | |
| </record> | |
| } | |
| </data> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment