DynamicContextSettings.UsePrivateNameTable PropertyDynamicContextSettings.UsePrivateNameTable PropertyDynamicContextSettings::UsePrivateNameTable Property

Gets or sets a value indicating whether a private name table should be used.

Syntax

Public Property UsePrivateNameTable As Boolean
        Get
        Set(ByVal value As Boolean)
public bool UsePrivateNameTable { get; set; }
public:
property bool UsePrivateNameTable {
    bool get();
    void set(bool value);
}
 

Property Value

Type: System.BooleanSystem.BooleanSystem::Boolean

trueTruetrue if a private name table should be used; otherwise, falseFalsefalse.

Remarks

Any nodes created during evaluation of the XQuery program, XPath expression or XSL transformation will have their names placed in a name table. Usually this is the name table specified by the NameTableNameTableNameTable property used during compilation.

Using a private name table results in any names that are not in the static name table to be added to a separate private name table.

If a DocumentSetDocumentSetDocumentSet is supplied, then it will be wrapped in a SharedDocumentSetSharedDocumentSetSharedDocumentSet using the private name table.

This can be helpful for the following reasons:

  • The standard NameTableNameTableNameTable implementation is not thread safe when adding names. Since a separate private name table is used for each evaluation, this is thread safe. If you are calling XmlPrime from multiple threads then consider using a ConcurrentNameTableConcurrentNameTableConcurrentNameTable instead.
  • Since the name of every node created by a query is added to the name table, then it is possible for the name table to grow each time the XQuery program, XPath expression or XSL transformation is evaluated. Using a private name table will stop this effect from compounding.

If a private name table is used, this can be accessed via the NameTableNameTableNameTable property of newly constructed nodes returned from the XQuery program, XPath expression or XSL transformation. Should these nodes be used as input to further XQuery programs, XPath expressions or XSL transformations, then the NameTableNameTableNameTable property should be set to this private name table before compilation to ensure correct behaviour.