This is an old revision of the document!
A very brief introduction to some commonly used technologies used in translator development.
XPath
<div id="names"> <span class="editor">George Spelvin</span>, <span class="translator">Andrea Johnson</span> </div> <table> <tr class="odd"> <td>Great Expectations</td> <td>Mediocre Plans</td> </tr> </table>
/
Separator between parts of the path*
match any tag/ /
one or more levels deeper (no space)..
go up one level[]
match a tag that has this (the contents of the brackets)@key
an attribute namedkey
text()
match a text node[2]
match the second matching node[last()]
match the last matching nodediv[@class=“important”]
match a<div>
with the attributeclass
, with the valueimportant
.td[contains(text(),“Expect”)]
match a<td>
which contains text that contains “Expect”
Plus much more. See the XPath specification and the XPath documentation of the Mozilla Developer Network.
Examples
/ /tr[@class=“odd”]/td
/ /table/ /td
/ /span[@class=“editor”]
Regular Expressions
.
matches any character[a-z01]
matches any of the lowercase English letters and the numbers 0 and 1 (()
surround a match expression+
Match one or more of the preceding expression*
Match 0 or more of the preceding expression?
Match 0 or 1 of the preceding expression