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