# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: # Zoriana Zaiats, 2014 # Yuri Chornoivan , 2017,2020,2026 # Zoriana Zaiats, 2014 msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-09-16 15:05+0000\n" "PO-Revision-Date: 2014-06-17 08:35+0000\n" "Last-Translator: Yuri Chornoivan , 2017,2020,2026\n" "Language-Team: Ukrainian (http://app.transifex.com/calibre/calibre/language/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: uk\n" "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" #: ../../../__w/calibre/calibre/manual/xpath.rst:4 msgid "XPath tutorial" msgstr "Підручник з XPath" #: ../../../__w/calibre/calibre/manual/xpath.rst:6 msgid "" "In this tutorial, you will be given a gentle introduction to `XPath " "`_, a query language that can be used " "to select arbitrary parts of `HTML `_ " "documents in calibre. XPath is a widely used standard, and googling it will " "yield a ton of information. This tutorial, however, focuses on using XPath " "for e-book related tasks like finding chapter headings in an unstructured " "HTML document." msgstr "У цій частині підручника ми наведемо вступні зауваження щодо `XPath `_, мови запитів, якою можна скористатися для вибору довільних частин документів `HTML `_ у calibre. XPath є широковживаним стандартом, отже, пошук у мережі надасть вам дуже багато інформації щодо неї. Втім, увагу у цій частині підручника зосереджено на використанні XPath для завдань, пов’язаних із електронними книгами, зокрема пошуку заголовків глав у неструктурованому документі HTML." #: ../../../__w/calibre/calibre/manual/xpath.rst:16 msgid "Contents" msgstr "Зміст" #: ../../../__w/calibre/calibre/manual/xpath.rst:19 msgid "Selecting by tag name" msgstr "Вибір за назвою теґу" #: ../../../__w/calibre/calibre/manual/xpath.rst:21 msgid "" "The simplest form of selection is to select tags by name. For example, " "suppose you want to select all the ``

`` tags in a document. The XPath " "query for this is simply::" msgstr "Найпростішою формою вибору є вибір теґів за назвою. Наприклад, припустімо, що вам хочеться вибрати усі теґи ``

`` у документі. Запит XPath для цього буде дуже простим::" #: ../../../__w/calibre/calibre/manual/xpath.rst:27 msgid "" "The prefix `//` means *search at any level of the document*. Now suppose you" " want to search for ```` tags that are inside ```` tags. That can " "be achieved with::" msgstr "Префікс «//» означає *шукати на усіх рівнях документа*. Тепер, припустімо, що ви хочете знайти теґи ````, які перебувають всередині теґів ````. Зробити це можна ось так::" #: ../../../__w/calibre/calibre/manual/xpath.rst:33 msgid "" "If you want to search for tags at a particular level in the document, change" " the prefix::" msgstr "Якщо ви хочете шукати теґи на певному рівні у документі, змініть префікс::" #: ../../../__w/calibre/calibre/manual/xpath.rst:39 msgid "" "This will match only ``

A very short e-book to demonstrate the use of " "XPath.

`` in the :ref:`sample_ebook` but not any of the other ``

`` " "tags. The ``h:`` prefix in the above examples is needed to match XHTML tags." " This is because internally, calibre represents all content as XHTML. In " "XHTML tags have a *namespace*, and ``h:`` is the namespace prefix for HTML " "tags." msgstr "Буде знайдено лише ``

A very short ebook to demonstrate the use of XPath.

`` у :ref:`sample_ebook`, але не буде знайдено жодного іншого теґу ``

``. Префікс ``h:`` у наведених вище прикладах потрібен для встановлення відповідності теґам XHTML. Він потрібен, тому що на внутрішньому рівні calibre представляє усі дані як XHTML. У теґів XHTML є власний *простір назв*, і ``h:`` є префіксом простору назв для теґів HTML." #: ../../../__w/calibre/calibre/manual/xpath.rst:45 msgid "" "Now suppose you want to select both ``

`` and ``

`` tags. To do that, " "we need an XPath construct called *predicate*. A :dfn:`predicate` is simply " "a test that is used to select tags. Tests can be arbitrarily powerful and as" " this tutorial progresses, you will see more powerful examples. A predicate " "is created by enclosing the test expression in square brackets::" msgstr "Тепер, припустімо, вам потрібно вибрати одразу теґи ``

`` і теґи ``

``. Для виконання цього завдання нам знадобиться конструкція XPath, яка називається *предикатом*. :dfn:`предикат` є простою перевіркою, яка використовується для вибору теґів. Перевірки можуть мати довільну потужність. У межах цього розділу ми наведемо і потужніші приклади. Предикат створюється взяттям виразу перевірки у квадратні дужки::" #: ../../../__w/calibre/calibre/manual/xpath.rst:53 msgid "" "There are several new features in this XPath expression. The first is the " "use of the wildcard ``*``. It means *match any tag*. Now look at the test " "expression ``name()='h1' or name()='h2'``. :term:`name()` is an example of a" " *built-in function*. It simply evaluates to the name of the tag. So by " "using it, we can select tags whose names are either `h1` or `h2`. Note that " "the :term:`name()` function ignores namespaces so that there is no need for " "the ``h:`` prefix. XPath has several useful built-in functions. A few more " "will be introduced in this tutorial." msgstr "У цьому виразі XPath є декілька нових особливостей. Першою є використання замінника ``*``. Цей замінник означає *знайти будь-який теґ*. Далі, зверніть увагу на вираз перевірки ``name()='h1' or name()='h2'``. :term:`name()` є прикладом *вбудованої функції*. Ця функція просто повертає назву теґу. Отже, за її допомогою ми можемо вибрати теґи, назвами яких є `h1` або `h2`. Зауважте, що функція :term:`name()` ігнорує простори назв, отже, у додаванні префікса ``h:`` немає потреби. У XPath є декілька корисних вбудованих функцій. Ще декілька буде представлено у цьому розділі." #: ../../../__w/calibre/calibre/manual/xpath.rst:62 msgid "Selecting by attributes" msgstr "Вибір за атрибутами" #: ../../../__w/calibre/calibre/manual/xpath.rst:64 msgid "" "To select tags based on their attributes, the use of predicates is " "required::" msgstr "Для вибору тегу на основі його атрибутів слід користуватися предикатами::" #: ../../../__w/calibre/calibre/manual/xpath.rst:70 msgid "" "Here, the ``@`` operator refers to the attributes of the tag. You can use " "some of the `XPath built-in functions`_ to perform more sophisticated " "matching on attribute values." msgstr "Тут оператор ``@`` посилається на атрибути теґу. Ви можете скористатися деякими з `вбудованих функцій XPath`_ для встановлення складних відповідностей із значеннями атрибутів." #: ../../../__w/calibre/calibre/manual/xpath.rst:75 msgid "" "When XPath expressions are used for conversion options such as chapter " "detection or the start reading at position, they are evaluated against the " "*input* document, before calibre flattens the CSS. CSS flattening rewrites " "class names, so the class names you see in the converted output (things like" " ``calibre1``) do not exist yet when your expression runs. Copy class names " "from the input document, not from the converted book. If in doubt, match on " "tag names and text content instead, as these are not changed by the " "conversion." msgstr "Коли вирази XPath використовуються для таких параметрів перетворення, як визначення розділів або початкова позиція читання, вони застосовуються до *вхідного* документа — ще до того, як calibre виконає спрощення CSS. Процес спрощення CSS змінює назви класів, тому назви, які ви бачите у вже перетвореному файлі (наприклад, `calibre1`), на момент виконання вашого виразу ще не існують. Копіюйте назви класів із вхідного документа, а не з перетвореної книги. Якщо маєте сумніви, орієнтуйтеся на назви тегів і текстовий вміст, оскільки вони не змінюються під час перетворення." #: ../../../__w/calibre/calibre/manual/xpath.rst:86 msgid "Selecting by tag content" msgstr "Вибір за вмістом теґу" #: ../../../__w/calibre/calibre/manual/xpath.rst:88 msgid "" "Using XPath, you can even select tags based on the text they contain. The " "best way to do this is to use the power of *regular expressions* via the " "built-in function :term:`re:test()`::" msgstr "За допомогою XPath ви навіть можете вибирати теґи на основі тексту, який у них міститься. Найкращим способом це зробити є використання потужності *формальних виразів*, тобто вбудованої функції :term:`re:test()`::" #: ../../../__w/calibre/calibre/manual/xpath.rst:94 msgid "" "Here the ``.`` operator refers to the contents of the tag, just as the ``@``" " operator referred to its attributes." msgstr "Тут оператор ``.`` посилається на вміст теґу, так само, як оператор ``@`` посилається на його атрибути." #: ../../../__w/calibre/calibre/manual/xpath.rst:100 msgid "Sample e-book" msgstr "Зразок книги" #: ../../../__w/calibre/calibre/manual/xpath.rst:106 msgid "XPath built-in functions" msgstr "Вбудовані функції XPath" #: ../../../__w/calibre/calibre/manual/xpath.rst:109 msgid "name()" msgstr "name()" #: ../../../__w/calibre/calibre/manual/xpath.rst:111 msgid "The name of the current tag." msgstr "Назва поточного теґу." #: ../../../__w/calibre/calibre/manual/xpath.rst:112 msgid "contains()" msgstr "contains()" #: ../../../__w/calibre/calibre/manual/xpath.rst:114 msgid "``contains(s1, s2)`` returns `true` if s1 contains s2." msgstr "``contains(s1, s2)`` повертає «true», якщо s1 містить s2." #: ../../../__w/calibre/calibre/manual/xpath.rst:115 msgid "re:test()" msgstr "re:test()" #: ../../../__w/calibre/calibre/manual/xpath.rst:117 msgid "" "``re:test(src, pattern, flags)`` returns `true` if the string `src` matches " "the regular expression `pattern`. A particularly useful flag is ``i``, it " "makes matching case insensitive. A good primer on the syntax for regular " "expressions can be found at `regexp syntax " "`_" msgstr "``re:test(джерело, взірець, прапорці)`` повертає `true`, якщо рядок `джерело` відповідає формальному виразу `взірець`. Одним із особливо корисних прапорців є ``i``, прапорець, який вимикає врахування регістру символів під час порівняння. Чудовий підручник із синтаксису формальних виразів можна знайти на `сторінці синтаксису формальних виразів `_"