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 named key
  • text() match a text node
  • [2] match the second matching node
  • [last()] match the last matching node
  • div[@class=“important”] match a <div> with the attribute class, with the value important.
  • 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
dev/technologies.1303368376.txt.gz · Last modified: 2011/04/21 02:46 by ajlyon