Skip to content

Commit 4ab8c0b

Browse files
committed
Incorporate suggested changes to HTML templating docs
1 parent af68610 commit 4ab8c0b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/xar-resources/data/templating/listings/listing-12.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import module namespace templates="http://exist-db.org/xquery/html-templating";
1515
:)
1616
import module namespace app="http://my.domain/myapp" at "app.xql";
1717

18-
declare option output:method "html5";
19-
declare option output:media-type "text/html";
18+
declare option output:method "html";
19+
declare option output:html-version "5";
2020

2121
(:
2222
: We have to provide a lookup function to templates:apply to help it

src/main/xar-resources/data/templating/templating.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
shared-resources package, while a <link xlink:href="https://github.com/eXist-db/templating/">new and improved version</link>
231231
is now available in its own
232232
expath package. We recommend to update to the new package with the short name
233-
<emphasis>templating</emphasis>, available on the eXist-db dashboard. To update, following the 3 steps below:</para>
233+
<emphasis>templating</emphasis>, available on the eXist-db dashboard. To update, follow the 3 steps below:</para>
234234
<orderedlist>
235235
<listitem>
236236
<para>change any dependency on shared-resources in your expath-pkg.xml to point to this package:</para>
@@ -254,17 +254,17 @@
254254
<programlisting language="xquery" xlink:href="listings/listing-12.txt"/>
255255
<para>This module would be called from the URL rewriting controller. For example, we could
256256
add a rule to <literal>controller.xq</literal> to pass any .html resource to the above
257-
main query (saved to <literal>modules/view.xql</literal>):</para>
257+
main query (saved to <literal>modules/view.xq</literal>):</para>
258258
<programlisting language="xquery" xlink:href="listings/listing-13.txt"/>
259259
<para>The only part of the main module code which might look a bit unusual is the inline
260260
lookup function: the templating module uses dynamic function calls to execute template
261261
functions in application modules. But unfortunately, XQuery modules can only "see"
262262
functions in their own context. There is therefore no way for the templating module to
263263
determine what functions are defined in application modules which are outside its
264-
context. So need to "help" it by providing a callback function to resolve function
264+
context. So it needs to be "helped" by providing a callback function to resolve function
265265
references. The lookup function is defined in the main context and can access all the
266266
modules imported into the main module.</para>
267-
<para>Normally you can just copy and paste the main module code as given above. To adopt it
267+
<para>Normally you can just copy and paste the main module code as given above. To adapt it
268268
to your own application, just import your application modules and you're done.</para>
269269
</sect2>
270270
</sect1>
@@ -277,7 +277,7 @@
277277
<para>The templating module defines a number of general-purpose templating functions which
278278
are described below. Functions marked as <emphasis>deprecated</emphasis> should not be used
279279
anymore. Those labelled with <emphasis>removed</emphasis> did exist in the old templating
280-
module (which shiped in the shared-resources package) and have been removed from the newer
280+
module (which was shipped in the shared-resources package) and has been removed from the newer
281281
templating package.</para>
282282
<para>Functions marked as <emphasis>new</emphasis> have been added in the new templating package
283283
and are not available in the older module.</para>

0 commit comments

Comments
 (0)