Difference between revisions of "Manual oXygen"
(→Search in directory) |
|||
(13 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
By searching for a phrase and selecting ‘Search all’, the results of the search are highlighted in yellow in the document. At the bottom of the screen, a panel with search results appears that you can use to walk through the hits in the document. | By searching for a phrase and selecting ‘Search all’, the results of the search are highlighted in yellow in the document. At the bottom of the screen, a panel with search results appears that you can use to walk through the hits in the document. | ||
− | + | [File:Pic_1.png|border|top]] | |
− | + | [[File:Pic_2.png|border]] | |
==XML search using XPATH== | ==XML search using XPATH== | ||
Line 20: | Line 20: | ||
See the following illustrations: | See the following illustrations: | ||
− | + | [[File:Pic_3.png|border|top]] | |
− | + | [[File:Pic_4.png|border]] | |
+ | [[File:Pic_5.png|border|top]] | ||
==Using Xpath to search a collection of documents== | ==Using Xpath to search a collection of documents== | ||
Line 27: | Line 28: | ||
It is possible to search using Xpath over any collection of documents. The Xpath search box has a dropdown where you indicate which file(s) to search. See below. | It is possible to search using Xpath over any collection of documents. The Xpath search box has a dropdown where you indicate which file(s) to search. See below. | ||
− | + | [[File:Pic_6.png|border]] | |
There are some predefined options, but you can also define your own working set of documents. I defined a working set consisting of all letters using the Configure Xpath working sets option. This options lets you create a New working set (pressing the corresponding button), which you can then give a name and add resources to (in this case, the folder with letters in my working copy). | There are some predefined options, but you can also define your own working set of documents. I defined a working set consisting of all letters using the Configure Xpath working sets option. This options lets you create a New working set (pressing the corresponding button), which you can then give a name and add resources to (in this case, the folder with letters in my working copy). | ||
− | + | [[File:Pic_7.png|border]] | |
− | + | [[File:Pic_8.png|border]] | |
− | + | [[File:Pic_9.png|border|top]] | |
− | + | Having done this, it is possible to run any XPath query over the entire collection of letters. For example, search for distinct-values (//rs[@type="person"]) to find all persons encoded in the letters. | |
− | + | ||
− | + | ||
− | Having done this, it is possible to run any XPath query over the entire collection of letters. For example, search for | + | |
− | + | ||
− | to find all persons encoded in the letters. | + | |
The result is displayed at the bottom of the screen: | The result is displayed at the bottom of the screen: | ||
− | + | [[File:Pic_10.png|border]] | |
This can be sorted, selected and copied for further processing. | This can be sorted, selected and copied for further processing. | ||
Execution of the query might encounter problems if some of the files are not valid XML. These errors will be reported in an Xpath problems tab. | Execution of the query might encounter problems if some of the files are not valid XML. These errors will be reported in an Xpath problems tab. | ||
− | |||
==Search in directory== | ==Search in directory== | ||
− | Menu Find, option Find/Replace in Files | + | Menu Find, option Find/Replace in Files. |
− | + | ||
==Indent text selection== | ==Indent text selection== | ||
Select text block, right mouse click, option Source, option Indent Selection. | Select text block, right mouse click, option Source, option Indent Selection. | ||
− | You can also indent an element (e.g. a | + | You can also indent an element (e.g. a <div>) by placing the cursor in the element (not in a subordinate element) and doing right mouse click, option Source, option Indent Element. |
+ | |||
+ | ==See also== | ||
+ | * [[Manual Subversion]] | ||
[[Category:XML Huygens]] | [[Category:XML Huygens]] | ||
[[Category:Manuals]] | [[Category:Manuals]] |
Latest revision as of 10:50, 25 January 2017
oXygen XML Editor is the tool that the Huygens ING uses to produce its XML files and to convert them to a HTML format [? en meer?]. oXygen is suited for XML editors on a beginner level, but can appear a little overwhelming at first. This manual contains a couple of tips on how to work with the programme.
Contents
Search all
By searching for a phrase and selecting ‘Search all’, the results of the search are highlighted in yellow in the document. At the bottom of the screen, a panel with search results appears that you can use to walk through the hits in the document.
XML search using XPATH
XPATH is a language for formulating search queries against XML documents. It sees a document not as a series of characters or words, but as a collection of elements with attributes and content. Using the search box in the top-left corner of the screen you can search based on the XML structure of the document, using the XPATH language. The results are again displayed at the bottom of the document, and highlighted in the source (blue).
Things you can do:
- select all unclear elements: //unclear
- select all values of the rs type-attribute: //rs/@type
- select all unique values of the rs type-attribute: distinct-values(//rs/@type)
- select all xml:id values: //*/@xml:id
See the following illustrations:
Using Xpath to search a collection of documents
It is possible to search using Xpath over any collection of documents. The Xpath search box has a dropdown where you indicate which file(s) to search. See below.
There are some predefined options, but you can also define your own working set of documents. I defined a working set consisting of all letters using the Configure Xpath working sets option. This options lets you create a New working set (pressing the corresponding button), which you can then give a name and add resources to (in this case, the folder with letters in my working copy).
Having done this, it is possible to run any XPath query over the entire collection of letters. For example, search for distinct-values (//rs[@type="person"]) to find all persons encoded in the letters.
The result is displayed at the bottom of the screen:
This can be sorted, selected and copied for further processing.
Execution of the query might encounter problems if some of the files are not valid XML. These errors will be reported in an Xpath problems tab.
Search in directory
Menu Find, option Find/Replace in Files.
Indent text selection
Select text block, right mouse click, option Source, option Indent Selection. You can also indent an element (e.g. a <div>) by placing the cursor in the element (not in a subordinate element) and doing right mouse click, option Source, option Indent Element.