|
230 | 230 | shared-resources package, while a <link xlink:href="https://github.com/eXist-db/templating/">new and improved version</link>
|
231 | 231 | is now available in its own
|
232 | 232 | 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> |
234 | 234 | <orderedlist>
|
235 | 235 | <listitem>
|
236 | 236 | <para>change any dependency on shared-resources in your expath-pkg.xml to point to this package:</para>
|
|
254 | 254 | <programlisting language="xquery" xlink:href="listings/listing-12.txt"/>
|
255 | 255 | <para>This module would be called from the URL rewriting controller. For example, we could
|
256 | 256 | 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> |
258 | 258 | <programlisting language="xquery" xlink:href="listings/listing-13.txt"/>
|
259 | 259 | <para>The only part of the main module code which might look a bit unusual is the inline
|
260 | 260 | lookup function: the templating module uses dynamic function calls to execute template
|
261 | 261 | functions in application modules. But unfortunately, XQuery modules can only "see"
|
262 | 262 | functions in their own context. There is therefore no way for the templating module to
|
263 | 263 | 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 |
265 | 265 | references. The lookup function is defined in the main context and can access all the
|
266 | 266 | 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 |
268 | 268 | to your own application, just import your application modules and you're done.</para>
|
269 | 269 | </sect2>
|
270 | 270 | </sect1>
|
|
277 | 277 | <para>The templating module defines a number of general-purpose templating functions which
|
278 | 278 | are described below. Functions marked as <emphasis>deprecated</emphasis> should not be used
|
279 | 279 | 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 |
281 | 281 | templating package.</para>
|
282 | 282 | <para>Functions marked as <emphasis>new</emphasis> have been added in the new templating package
|
283 | 283 | and are not available in the older module.</para>
|
|
0 commit comments