| 1 |
# SOME DESCRIPTIVE TITLE. |
| 2 |
# Copyright (C) Kovid Goyal |
| 3 |
# This file is distributed under the same license as the calibre package. |
| 4 |
# |
| 5 |
# Translators: |
| 6 |
msgid "" |
| 7 |
msgstr "" |
| 8 |
"Project-Id-Version: calibre\n" |
| 9 |
"Report-Msgid-Bugs-To: \n" |
| 10 |
"POT-Creation-Date: 2014-10-17 08:20+0530\n" |
| 11 |
"PO-Revision-Date: 2014-10-17 02:53+0000\n" |
| 12 |
"Last-Translator: Kovid Goyal <[email protected]>\n" |
| 13 |
"Language-Team: Slovenian (Slovenia) (http://www.transifex.com/projects/p/calibre/language/sl_SI/)\n" |
| 14 |
"MIME-Version: 1.0\n" |
| 15 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 16 |
"Content-Transfer-Encoding: 8bit\n" |
| 17 |
"Language: sl_SI\n" |
| 18 |
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" |
| 19 |
|
| 20 |
# c7cdf4005c01406ab53de64a03a25819 |
| 21 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:4 |
| 22 |
msgid "XPath Tutorial" |
| 23 |
msgstr "" |
| 24 |
|
| 25 |
# d47724426f17493e87b6312191c9bba2 |
| 26 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:6 |
| 27 |
msgid "" |
| 28 |
"In this tutorial, you will be given a gentle introduction to `XPath " |
| 29 |
"<http://en.wikipedia.org/wiki/XPath>`_, a query language that can be used to" |
| 30 |
" select arbitrary parts of `HTML <http://en.wikipedia.org/wiki/HTML>`_ " |
| 31 |
"documents in calibre. XPath is a widely used standard, and googling it will " |
| 32 |
"yield a ton of information. This tutorial, however, focuses on using XPath " |
| 33 |
"for ebook related tasks like finding chapter headings in an unstructured " |
| 34 |
"HTML document." |
| 35 |
msgstr "" |
| 36 |
|
| 37 |
# 4b2e9f1492c64b6080bd1dcc2235198a |
| 38 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:0 |
| 39 |
msgid "Contents" |
| 40 |
msgstr "" |
| 41 |
|
| 42 |
# f6798e661047483a8c007d46243b1567 |
| 43 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:19 |
| 44 |
msgid "Selecting by tagname" |
| 45 |
msgstr "" |
| 46 |
|
| 47 |
# 5b0e8babb8e6449fb56507a8a472a2b2 |
| 48 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:21 |
| 49 |
msgid "" |
| 50 |
"The simplest form of selection is to select tags by name. For example, " |
| 51 |
"suppose you want to select all the ``<h2>`` tags in a document. The XPath " |
| 52 |
"query for this is simply::" |
| 53 |
msgstr "" |
| 54 |
|
| 55 |
# b3bb6d91d4de425287dece54ba56fee6 |
| 56 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:27 |
| 57 |
msgid "" |
| 58 |
"The prefix `//` means *search at any level of the document*. Now suppose you" |
| 59 |
" want to search for ``<span>`` tags that are inside ``<a>`` tags. That can " |
| 60 |
"be achieved with::" |
| 61 |
msgstr "" |
| 62 |
|
| 63 |
# 3ca7dbc3a4ff42b99bbb99fcc0b67581 |
| 64 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:33 |
| 65 |
msgid "" |
| 66 |
"If you want to search for tags at a particular level in the document, change" |
| 67 |
" the prefix::" |
| 68 |
msgstr "" |
| 69 |
|
| 70 |
# cb178dbc974e482e95cc6c0b98f2e69a |
| 71 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:39 |
| 72 |
msgid "" |
| 73 |
"This will match only ``<p>A very short ebook to demonstrate the use of " |
| 74 |
"XPath.</p>`` in the :ref:`sample_ebook` but not any of the other ``<p>`` " |
| 75 |
"tags. The ``h:`` prefix in the above examples is needed to match XHTML tags." |
| 76 |
" This is because internally, calibre represents all content as XHTML. In " |
| 77 |
"XHTML tags have a *namespace*, and ``h:`` is the namespace prefix for HTML " |
| 78 |
"tags." |
| 79 |
msgstr "" |
| 80 |
|
| 81 |
# ca80dc6a26dd41d1a38bd4a6655a9ad4 |
| 82 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:45 |
| 83 |
msgid "" |
| 84 |
"Now suppose you want to select both ``<h1>`` and ``<h2>`` tags. To do that, " |
| 85 |
"we need a XPath construct called *predicate*. A :dfn:`predicate` is simply a" |
| 86 |
" test that is used to select tags. Tests can be arbitrarily powerful and as " |
| 87 |
"this tutorial progresses, you will see more powerful examples. A predicate " |
| 88 |
"is created by enclosing the test expression in square brackets::" |
| 89 |
msgstr "" |
| 90 |
|
| 91 |
# 71320e0868c74c299c6a7d1422486057 |
| 92 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:53 |
| 93 |
msgid "" |
| 94 |
"There are several new features in this XPath expression. The first is the " |
| 95 |
"use of the wildcard ``*``. It means *match any tag*. Now look at the test " |
| 96 |
"expression ``name()='h1' or name()='h2'``. :term:`name()` is an example of a" |
| 97 |
" *built-in function*. It simply evaluates to the name of the tag. So by " |
| 98 |
"using it, we can select tags whose names are either `h1` or `h2`. Note that " |
| 99 |
"the :term:`name()` function ignores namespaces so that there is no need for " |
| 100 |
"the ``h:`` prefix. XPath has several useful built-in functions. A few more " |
| 101 |
"will be introduced in this tutorial." |
| 102 |
msgstr "" |
| 103 |
|
| 104 |
# 57a03c85e57545d6952158ee129fbfb7 |
| 105 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:62 |
| 106 |
msgid "Selecting by attributes" |
| 107 |
msgstr "" |
| 108 |
|
| 109 |
# ed2ceb42924d4e8e81cc834c8f100875 |
| 110 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:64 |
| 111 |
msgid "" |
| 112 |
"To select tags based on their attributes, the use of predicates is " |
| 113 |
"required::" |
| 114 |
msgstr "" |
| 115 |
|
| 116 |
# 153ee24e18034e93bb5fcbc58e260fd0 |
| 117 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:70 |
| 118 |
msgid "" |
| 119 |
"Here, the ``@`` operator refers to the attributes of the tag. You can use " |
| 120 |
"some of the `XPath built-in functions`_ to perform more sophisticated " |
| 121 |
"matching on attribute values." |
| 122 |
msgstr "" |
| 123 |
|
| 124 |
# 90ea9c076fcc4ed6a145dfe2eb710129 |
| 125 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:76 |
| 126 |
msgid "Selecting by tag content" |
| 127 |
msgstr "" |
| 128 |
|
| 129 |
# 947ba266588b4a9eb6f3d430a7d6d363 |
| 130 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:78 |
| 131 |
msgid "" |
| 132 |
"Using XPath, you can even select tags based on the text they contain. The " |
| 133 |
"best way to do this is to use the power of *regular expressions* via the " |
| 134 |
"built-in function :term:`re:test()`::" |
| 135 |
msgstr "" |
| 136 |
|
| 137 |
# d01c87d62c214adf80cf262dad020766 |
| 138 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:84 |
| 139 |
msgid "" |
| 140 |
"Here the ``.`` operator refers to the contents of the tag, just as the ``@``" |
| 141 |
" operator referred to its attributes." |
| 142 |
msgstr "" |
| 143 |
|
| 144 |
# feaea9757f8b404f9cfb44ab114ae618 |
| 145 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:90 |
| 146 |
msgid "Sample ebook" |
| 147 |
msgstr "" |
| 148 |
|
| 149 |
# ffb2e6ed2a544a76804b69413474c069 |
| 150 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:96 |
| 151 |
msgid "XPath built-in functions" |
| 152 |
msgstr "" |
| 153 |
|
| 154 |
# 44feb537bd154fd1b86f99e8e832fe4b |
| 155 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:99 |
| 156 |
msgid "name()" |
| 157 |
msgstr "" |
| 158 |
|
| 159 |
# b64b2199a5d24a93b219e68b74105128 |
| 160 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:101 |
| 161 |
msgid "The name of the current tag." |
| 162 |
msgstr "" |
| 163 |
|
| 164 |
# 9eaa524a9e604754acdce8d8291a0b91 |
| 165 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:102 |
| 166 |
msgid "contains()" |
| 167 |
msgstr "" |
| 168 |
|
| 169 |
# afa03084eb494eca889c859b7a33d5f0 |
| 170 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:104 |
| 171 |
msgid "``contains(s1, s2)`` returns `true` if s1 contains s2." |
| 172 |
msgstr "" |
| 173 |
|
| 174 |
# a72be0f4a07b40dc94878093c24809de |
| 175 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:105 |
| 176 |
msgid "re:test()" |
| 177 |
msgstr "" |
| 178 |
|
| 179 |
# db4da15a442a4e8e986baed92b63bce3 |
| 180 |
#: ../../home/kovid/work/calibre/manual/xpath.rst:107 |
| 181 |
msgid "" |
| 182 |
"``re:test(src, pattern, flags)`` returns `true` if the string `src` matches " |
| 183 |
"the regular expression `pattern`. A particularly useful flag is ``i``, it " |
| 184 |
"makes matching case insensitive. A good primer on the syntax for regular " |
| 185 |
"expressions can be found at `regexp syntax <http://docs.python.org/lib/re-" |
| 186 |
"syntax.html>`_" |
| 187 |
msgstr "" |