Skip to content

Note the limitations of the node selectors #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ <h4>Node selectors</h4>

<p>Translation of these XPath selectors may be necessary if the input record is transformed into
another form, such as a JSON structure.</p>

<p>Note that the node selectors in this document only account for EPUB 3 metadata. To process
EPUB 2 publications, compatible XPaths will need to be provided.</p>
</section>

<section id="output-statements">
Expand Down Expand Up @@ -243,15 +246,11 @@ <h3>Check for node</h3>
<p>Many of the techniques rely on checking for the presence or absence of metadata in the metadata
section of the Package document.</p>

<aside class="note">
<p>All XPATHs are made for EPUB 3, while for EPUB 2 they would need to be adjusted.</p>
</aside>

<p>This algorithm takes:</p>
<ul>
<li>the <var>package_document</var> argument: the internal representation of the Package document
(output of <a href="#pre-processing">preprocessing</a>);</li>
<li>the <var>path</var> argument: the XPATH of the node to check the presence of.</li>
<li>the <var>path</var> argument: the XPath of the node to check the presence of.</li>
</ul>
<p>To check for node, run the following steps:</p>
<ol class="condition">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ <h4>Node selectors</h4>

<p>Translation of these XPath selectors may be necessary if the input record is transformed into
another form, such as a JSON structure.</p>

<p>Note that the node selectors in this document only account for ONIX records that use <a
href="https://www.editeur.org/74/faqs/#q10">reference names</a>. To process records that
use short tags, the records will either need to be <a
href="https://www.editeur.org/93/release-3.0-downloads/#Tools">transformed to use reference
names</a> or compatible XPaths will need to be provided.</p>
</section>

<section id="output-statements">
Expand Down Expand Up @@ -206,7 +212,6 @@ <h4>Output statements</h4>
</section>
</section>
</section>

<section id="common-functions">
<h2>Common Functions</h2>
<p>In this section we define the functions common to all techniques, which are called by them during execution.</p>
Expand All @@ -224,7 +229,7 @@ <h3>Preprocessing</h3>
<li>return <var>onix</var>.</li>
</ul>
<aside class="note">
<p>The XML file being processed may contain namespaces, in the techniques when we use XPATH we will assume that the default namespace of the root record is used.</p>
<p>The XML file being processed may contain namespaces, in the techniques when we use XPath we will assume that the default namespace of the root record is used.</p>
</aside>
</section>
<section id="check-for-node">
Expand All @@ -233,7 +238,7 @@ <h3>Check for node</h3>
<p>This algorithm takes:</p>
<ul>
<li>the <var>onix</var> argument: the internal representation of ONIX record (output of <a href="#preprocessing">preprocessing</a>);</li>
<li>the <var>path</var> argument: the XPATH of the node to check the presence of.</li>
<li>the <var>path</var> argument: the XPath of the node to check the presence of.</li>
</ul>
<p>To check for node, run the following steps:</p>
<ol class="condition">
Expand Down