Skip to content

Commit 06e23db

Browse files
dizzzzline-o
authored andcommitted
[documentation] Add grammar-cache documentation, removed some inconsistencies.
1 parent 16ad160 commit 06e23db

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

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

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:xlink="http://www.w3.org/1999/xlink">
66
<info>
77
<title>Application Server Configuration</title>
8-
<date>2Q21</date>
8+
<date>4Q25</date>
99
<keywordset>
1010
<keyword>operations</keyword>
1111
</keywordset>
@@ -819,11 +819,51 @@
819819
<sect2 xml:id="validations">
820820
<title> <tag>validation</tag> element </title>
821821

822-
<para>Defines the default validation settings active when parsing XML and links to
823-
catalog files. Catalog files are used to locate DTDs, schemas and resolve external
824-
entities in general.</para>
825-
<para>Please refer to the corresponding documentation on <link
826-
xlink:href="validation">XML Validation</link>.</para>
822+
<para>This section allows to configure the validation settings of the XML parser when an XML document is inserted into the database,
823+
the location of the catalog files and the characteristics of the grammar cache.</para>
824+
825+
<programlisting language="xml" xlink:href="listings/listing-11.xml"/>
826+
827+
<para>The validation mode and the catalog <tag>entity-resolver</tag> items are discussed in the separate
828+
document <link xlink:href="validation">XML Validation</link>.</para>
829+
830+
<para>The <tag>grammar-cache</tag> (added in eXist-db v7.0) configures the properties of the XML parser grammar cache. The cache contains
831+
compiled versions of XSD and DTD grammar files that are generated by the XML parser when the XML parser is set in validating mode.
832+
Re-use of these compiled versions can accellerate the validation process significantly.
833+
</para>
834+
<para>
835+
The following items can be configured:
836+
</para>
837+
<sect3 xml:id="grammar-cache-att">
838+
<title> <tag>grammar-cache</tag> attributes</title>
839+
840+
<variablelist>
841+
<varlistentry>
842+
<term> <code>size</code> </term>
843+
<listitem>
844+
<para>Specifies the maximum number of entries the cache may contain. The following values can be used: </para>
845+
<itemizedlist>
846+
<listitem>
847+
<para> <code> 0</code>: grammars will be evicted immediately after being loaded into the cache.</para>
848+
</listitem>
849+
<listitem>
850+
<para> <code>-1</code>: no maximum for the number of cached grammars.</para>
851+
</listitem>
852+
</itemizedlist>
853+
854+
855+
</listitem>
856+
</varlistentry>
857+
<varlistentry>
858+
<term> <code>expire</code> </term>
859+
<listitem>
860+
<para>The time (in seconds) after which an unused grammar should expire and be removed
861+
from the grammar pool. For value <literal>-1</literal> grammars will not be removed over time.</para>
862+
</listitem>
863+
</varlistentry>
864+
</variablelist>
865+
</sect3>
866+
827867
</sect2>
828868

829869
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<validation mode="no">
2+
<entity-resolver>
3+
<catalog uri="${WEBAPP_HOME}/WEB-INF/catalog.xml"/>
4+
</entity-resolver>
5+
<grammar-cache size="500" expire="3600"/>
6+
</validation>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:xlink="http://www.w3.org/1999/xlink">
66
<info>
77
<title>XML Validation</title>
8-
<date>2Q19</date>
8+
<date>4Q25</date>
99
<keywordset>
1010
<keyword>application-development</keyword>
1111
<keyword>testing</keyword>
@@ -18,7 +18,7 @@
1818
<para>There are two ways to validate documents: </para>
1919
<itemizedlist>
2020
<listitem>
21-
<para> <xref linkend="sect-implicit-validation"/>happens automatically when
21+
<para> <xref linkend="sect-implicit-validation"/> happens automatically when
2222
inserting documents into the database.</para>
2323
</listitem>
2424
<listitem>

0 commit comments

Comments
 (0)