Difference between revisions of "Manual oXygen"

From XML
Jump to: navigation, search
Line 6: Line 6:
  
 
   
 
   
x1
+
x1
  
 
==XML search using XPATH==
 
==XML search using XPATH==
Line 13: Line 13:
  
 
Things you can do:  
 
Things you can do:  
select all unclear elements: //unclear
+
* select all unclear elements: //unclear
select all values of the rs type-attribute: //rs/@type
+
* 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 unique values of the rs type-attribute: distinct-values(//rs/@type)
select all xml:id values: //*/@xml:id
+
* select all xml:id values: //*/@xml:id
  
 
See the following illustrations:
 
See the following illustrations:
 
   
 
   
x234  
+
x234  
  
  
Line 32: Line 32:
  
 
   
 
   
x678
+
x678
 
   
 
   
  

Revision as of 09:47, 19 January 2017

[...]

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.


x1

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:

x234 	 


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.

x5

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).


x678



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:

x9

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
) by placing the cursor in the element (not in a subordinate element) and doing right mouse click, option Source, option Indent Element.