WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:sqlEscapeDOM
Description:The active:sqlEscapeDOM service accepts an DOM representation and returns a new DOM representation with any String object values converted using "escape" substitutions.
Id:mod-db:sqlEscapeDOM
Category:accessor
Identifier Syntax

sqlEscapeDOM is an accessor using Active URI syntax with the following base identifiers:

Base
active:sqlEscapeDOM

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
operand
Mandatory
Representation (java.lang.Object)DOM structure to which escape substitutions are applied
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use sqlEscapeDOM accessor you must import the module urn:org:netkernel:mod:db:

<import>
  <uri>urn:org:netkernel:mod:db</uri>
</import>

When a request with the SOURCE verb is issued to active:sqlEscapeDOM the DOM structure specified in the required operand argument is examined and if any nodes are found of the class String then they are "escaped". The returned representation is always a new DOM structure even if there are no nodes with String objects.

For example, the DOM structure:

<customer>
  <name>Fred's bakery</name>
</customer>

will be converted to a new DOM structure:

<customer>
  <name>Fred''s bakery</name>
</customer>

Example

The following code performs the SQL escaping of a passed argument value.

domToEscape = context.source("arg:operand", Document.class);
request = context.createRequest("active:sqlEscapeHDS")
request.addArgumentByValue("operand", domToEscape)
escapedDOM = context.issueRequest(request)