-
Notifications
You must be signed in to change notification settings - Fork 0
Useful XPaths
Amanda Ross edited this page Apr 14, 2018
·
43 revisions
The following XPaths may be useful when working in a single volume or across volumes. To use in oxygenXML:
- Open the XPath/XQuery Builder [Window -> Show View -> XPath/XQuery Builder].
- Copy or type the XPath into the XPath/XQuery Builder (eliminate any line breaks, which are rendered below for readability).
- In the Project pane, select/highlight desired volume(s).
- Press the RUN (red forward arrow) button to run the XPath across your selections.
- Results should appear in a new pane at the bottom of your oxygenXML.
To add as a favorite for re-use:
- In the XPath/XQuery builder, enter the desired XPath/XQuery expression and click on the star outline on the top right toolbar.
- Enter a descriptive name for your tool (e.g. "Dates in (French)" and click OK.
- You may now re-use your favorited XPath/XQuery by clicking on the arrow to the right of the star and selecting your desired tool.
NOTE: Many of these XPaths have been used as the basis for Schematron Quick Fixes in dates-only-secondary-review.sch
(currently in draft form).
[Caption: Animated GIF of Secondary Date Review Schematron Quick Fix Example]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//postscript[matches(.,'(the\s+)?\d{1,2}(st|d|nd|rd|th)?\s+(of\s+)?
(January|February|March|April|May|June|July|August|September|October|November|December)
,?\s+\d{4}|
((January|February|March|April|May|June|July|August|September|October|November|December)
\s+\d{1,2}(st|d|nd|rd|th)?
,?\s+\d{4})')]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//postscript[matches(.,'(le\s+)?\d{1,2}(eme|ème|re)?\s+(de\s+)?
(janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
,?\s+\d{4}|
((janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
\s+\d{1,2}(eme|ème|re)?
,?\s+\d{4})')]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//postscript[matches(.,'(el\s+)?\d{1,2}\s+((de|del)\s+)?
(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
,?\s+((de|del)\s+)?\d{4}|
((enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
\s+\d{1,2}
,?\s+\d{4})')]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//p[last()][matches(.,'(the\s+)?\d{1,2}(st|d|nd|rd|th)?\s+(of\s+)?
(January|February|March|April|May|June|July|August|September|October|November|December)
,?\s+\d{4}|
((January|February|March|April|May|June|July|August|September|October|November|December)
\s+\d{1,2}(st|d|nd|rd|th)?,?
\s+\d{4})')]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//p[last()][matches(.,'(le\s+)?\d{1,2}(eme|ème|re)?\s+(de\s+)?
(janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
,?\s+\d{4}|
((janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
\s+\d{1,2}(st|d|nd|rd|th)?
,?\s+\d{4})')]
//div[attribute::type='document']
[not(attribute::subtype='editorial-note')][not(descendant::date)]
//p[last()][matches(.,'(el\s+)?\d{1,2}?\s+((de|del)\s+)?
(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
,?\s+((de|del)\s+)?\d{4}|
((enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
\s+\d{1,2}
,?\s+\d{4})')]
A.3. To find dateline//date
in document with head
containing "Conversation" (in order to add subtype="conversation-or-meeting-date"):
//div[attribute::subtype = 'historical-document'][matches(head/., '[Mm]emorandum\s+of\s+(a\s+)?((Trans-Atlantic|Transatlantic)?\s+)?(Telephone\s+)?[Cc]onversation')]/dateline[not(descendant::*[local-name() = 'attachment'])]//date
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//p[last()][matches(., '(the\s+)?\d{1,2}(st|d|nd|rd|th)?\s+(of\s+)?
(January|February|March|April|May|June|July|August|September|October|November|December)
,?\s+\d{4}|
((January|February|March|April|May|June|July|August|September|October|November|December)
\s+\d{1,2}(st|d|nd|rd|th)?
,?\s+\d{4})')]
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//p[last()][matches(.,'(le\s+)?\d{1,2}(eme|ème|re)?\s+(de\s+)?
(janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
,?\s+\d{4}|
((janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
\s+\d{1,2}(eme|ème|re)?
,?\s+\d{4})')]
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//p[last()][matches(.,'(el\s+)?\d{1,2}?\s+((de|del)\s+)?
(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
,?\s+((de|del)\s+)?\d{4}|
((enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
\s+\d{1,2}(st|d|nd|rd|th)?
,?\s+\d{4})')]
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//postscript[matches(., '(the\s+)?\d{1,2}(st|d|nd|rd|th)?\s+(of\s+)?
(January|February|March|April|May|June|July|August|September|October|November|December)
,?\s+\d{4}|
((January|February|March|April|May|June|July|August|September|October|November|December)
\s+\d{1,2}(st|d|nd|rd|th)?
,?\s+\d{4})')]
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//postscript[matches(.,'(le\s+)?\d{1,2}(eme|ème|re)?\s+(de\s+)?
(janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
,?\s+\d{4}|
((janvier|février|fevrier|mart|avril|mai|juin|juillet|août|aout|septembre|octobre|novembre|décembre|decembre)
\s+\d{1,2}(eme|ème|re)?
,?\s+\d{4})')]
//div[attribute::type='document'][not(attribute::subtype='editorial-note')]
//*[local-name()='attachment'][not(descendant::date)]
//postscript[matches(.,'(el\s+)?\d{1,2}?\s+((de|del)\s+)?
(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
,?\s+((de|del)\s+)?\d{4}|
((enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|setiembre|octubre|noviembre|diciembre)
\s+\d{1,2}?
,?\s+\d{4})')]
//body//date[not(attribute::*)]
//body//date[not(attribute::*)][not(matches(data(.),'[Uu]ndated'))]
//body//div[attribute::type = ('compilation', 'chapter', 'subchapter')][not(attribute::subtype = ('index', 'referral'))][not(descendant::div[attribute::type = ('document')])]
//body//div[not(attribute::subtype = ('editorial-note','errata_document-numbering-error'))][not(attribute::*[local-name() eq "doc-dateTime-min"])]
To the extent possible under law, the
Office of the Historian at the U.S. Department of State
has waived all copyright and related or neighboring rights to
FRUS Dates Project.
This work is published from:
United States.
External Resources