Skip to content

Commit f257ceb

Browse files
authored
Merge pull request #60 from claudius108/master
Added support for processing the 'xref' elements
2 parents 421986c + 1f42d24 commit f257ceb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

data/lucene.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@
519519
<para>Sometimes you may want to define different Lucene indexes on the same set of elements, e.g.
520520
to use a different analyzer. eXist-db allows to name a certain index using the <option>field</option>
521521
attribute:</para>
522-
<synopsis language="xquery"><![CDATA[<text field="title" qname="title" analyzer="en"/>]]></synopsis>
523-
<para>Such an index is called <option>named index</option>. See <ulink url="#query-a-named-index">Query a Named Index</ulink> on how to query the
524-
<option>named indexes</option>.</para>
522+
<synopsis language="xquery">&lt;text field="title" qname="title" analyzer="en"/&gt;</synopsis>
523+
<para>Such an index is called <option>named index</option>. See <xref linkend="query-a-named-index"/> on how to query the
524+
<option>named indexes</option>.</para>
525525
</section>
526526
</section>
527527
<section>
@@ -552,7 +552,7 @@ return $m</programlisting>
552552
module.</para>
553553
<section id="query-a-named-index">
554554
<title>Query a Named Index</title>
555-
<para>To query a named index (see <ulink url="#named-indexes">Defining Fields</ulink>), use the <function>ft:query-field($fieldName, $query)</function> instead of
555+
<para>To query a named index (see <xref linkend="named-indexes"/>), use the <function>ft:query-field($fieldName, $query)</function> instead of
556556
<function>ft:query</function>:</para>
557557
<synopsis language="xquery">ft:query-field("title", "xml")</synopsis>
558558
<para>
@@ -818,11 +818,11 @@ return
818818
a document, containing information which does not exist in the XML as such.</para>
819819
<para>The field indexes are not configured via <filename>collection.xconf</filename>. Instead we add
820820
fields programmatically from an XQuery (which could be run via a trigger):</para>
821-
<programlisting language="xquery"><![CDATA[ft:index("/db/demo/test.xml", <doc>
822-
<field name="title" store="yes">Indexing</field>
823-
<field name="author" store="yes">Me</field>
824-
<field name="date" store="yes">2013</field>
825-
</doc>)]]></programlisting>
821+
<programlisting language="xquery">ft:index("/db/demo/test.xml", &lt;doc&gt;
822+
&lt;field name="title" store="yes"&gt;Indexing&lt;/field&gt;
823+
&lt;field name="author" store="yes"&gt;Me&lt;/field&gt;
824+
&lt;field name="date" store="yes"&gt;2013&lt;/field&gt;
825+
&lt;/doc&gt;)</programlisting>
826826
<para>The <option>store</option> attribute indicates that the fields content should be stored as a string.
827827
Without this attribute, the content will be indexed for search, but you won't be able to retrieve the contents.
828828
</para>

modules/docbook.xql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ declare %private function docbook:to-html($nodes as node()*) {
172172
<a href="{$node/@url}" target="_blank">{docbook:process-children($node)}</a>
173173
else
174174
<a href="{$node/@url}">{docbook:process-children($node)}</a>
175+
case element(xref) return
176+
<a href="#{$node/@linkend}">{root($node)/*//*[@id = $node/@linkend]/title/text()}</a>
175177
case element(note) return
176178
<div class="alert alert-success">
177179
{

0 commit comments

Comments
 (0)