Easysoft XML-ODBC Server User Guide - Document Type Definitions

Document Type Definitions for the Easysoft XML-ODBC Server

This section includes the Document Type Definitions (DTDs) for the various XML requests and responses sent to and from the Easysoft XML-ODBC Server.

Chapter Guide

Introduction

Document Type Definitions (DTDs) are supplied for the various requests, responses and updates sent to and from the Easysoft XML-ODBC Server.

SQL

The following DTDs are used for SQL requests and responses:

sql_request.dtd

Defines a SQL request to be sent to the Easysoft XML-ODBC Server:

<!ELEMENT Request (Environment*,

ConnectionString,

(Transaction|Sql),

Format?,

StyleSheet?)>

<!ELEMENT Environment (#PCDATA)>

<!ELEMENT ConnectionString (#PCDATA)>

<!ELEMENT Transaction (Sql+)>

<!ELEMENT Sql (#PCDATA)>

<!ELEMENT StyleSheet (Name, Type)>

<!ELEMENT Name (#PCDATA)>

<!ELEMENT Type (#PCDATA)>

<!ELEMENT Format ((Short | Long | Standard | TableTags), Data?, Binary?, TruncateTrailingBlanks?)>

<!ELEMENT Short EMPTY>

<!ELEMENT Long EMPTY>

<!ELEMENT Standard EMPTY>

<!ELEMENT TableTags EMPTY>

<!ELEMENT Data EMPTY>

<!ATTLIST Data Type (pcdata | cdata) "pcdata">

<!ELEMENT Binary EMPTY>

<!ATTLIST Binary Output (none | sql | base64) "sql">

<!ELEMENT TruncateTrailingBlanks EMPTY>

Environmentcontains zero or more strings of the form ENV_VAR=VALUE, one for for each operating system environment variable which is required to be set. ENV_VAR is the name of the variable and VALUE is the required value. This field may be useful when accessing certain drivers (Oracle®, for example, which requires ORACLE_HOME to be defined).

ConnectionString is ODBC defined, containing attributes and values separated by semicolons.

<Transaction> contains one or more SQL statements that your database accepts.

<Sql> is any SQL statement that your database accepts.

If defined, <StyleSheet> must contain "Name" and "Type" elements, which add an xml-stylesheet Processing Instruction to the start of the output, setting href to the value in "Name" and type to the value in "Type".

If defined, <Format> must contain ONE of <Long>, <Short>, <Standard> and <TableTags>, where <Standard> is currently the same as <Long> (see "Example SQL XML" on page 90). <Data>, <Binary> and <TruncateTrailingBlanks> are optional.

<Data>:

<Data Type = "pcdata"> (the default) specifies that column data be output as PCDATA and non 7-bit ASCII characters be output as character references.

<Data Type = "cdata"> specifies that column data be output in CDATA sections and non-ASCII data be output as pure UTF-8.

<Binary>:

Output="none" specifies that binary columns be ignored.

Output="sql" specifies that binary columns be retrieved in ODBC SQL_C_CHAR format and output as two digit hex strings.

Output="base64" specifies that binary columns be output in base 64.

<TruncateTrailingBlanks> removes the trailing spaces at the end of SQL_CHAR columns.

sql_response_long.dtd

Specifies the result of a SQL request sent to the Easysoft XML-ODBC Server where the <Long> output Format was requested:

<!ELEMENT Result (Row* | Diagnostic*)>

<!ATTLIST Result State CDATA #REQUIRED>

<!-- Note that State="00000" for all success cases -->

<!ELEMENT Row (Column*)>

<!ELEMENT Column (#PCDATA)>

<!ATTLIST Column Name CDATA #REQUIRED>

<!ELEMENT Diagnostic (State, Native, Text)>

<!ATTLIST Diagnostic Number CDATA #REQUIRED>

<!ELEMENT State (#PCDATA)>

<!ELEMENT Native (#PCDATA)>

<!ELEMENT Text (#PCDATA)>

sql_response_short.dtd

Specifies the result of a SQL request sent to the Easysoft XML-ODBC Server where the <Short> output Format was requested:

<!ELEMENT Result ((Columns, Rows) | Diagnostic*)>

<!ATTLIST Result State CDATA #REQUIRED>

<!-- Note that State="00000" for all success cases -->

<!ELEMENT Columns (Column*)>

<!ELEMENT Rows (Row*)>

<!ELEMENT Row (Column*)>

<!ELEMENT Column (#PCDATA)>

<!ELEMENT Diagnostic (State, Native, Text)>

<!ATTLIST Diagnostic Number CDATA #REQUIRED>

<!ELEMENT State (#PCDATA)>

<!ELEMENT Native (#PCDATA)>

<!ELEMENT Text (#PCDATA)>

sql_response_tabletags.dtd

Specifies the result of a SQL request sent to the Easysoft XML-ODBC Server where the <TableTags> output Format was requested:

CursorName is the result of calling SQLGetCursorName in the ODBC driver. <Column1Name>, <Column2Name>... etc. are the actual names of the columns in the result set.

<!ELEMENT Result (CursorName* | Diagnostic*)>

<!ATTLIST Result State CDATA #REQUIRED>

<!-- Note that State="00000" for all success cases -->

<!ELEMENT CursorName (Column1Name, Column2Name, Column3Name)>

<!ELEMENT Column1Name (#PCDATA)>

<!ELEMENT Column2Name (#PCDATA)>

<!ELEMENT Column3Name (#PCDATA)>

<!ELEMENT Diagnostic (State, Native, Text)>

<!ATTLIST Diagnostic Number CDATA #REQUIRED>

<!ELEMENT State (#PCDATA)>

<!ELEMENT Native (#PCDATA)>

<!ELEMENT Text (#PCDATA)>


NB

An error response in any of sql_response_long, sql_response_short or sql_response_tabletagscan be distinguished by examining the <State> attribute in the <Request> element, which will be either "00000" for successful requests, or some other state (defined by ODBC) for unsuccessful requests (see "SQL Error response" on page 94).


Configuration

The following DTDs are used to request, receive and update Easysoft XML-ODBC Server configuration details:

config_request.dtd

Defines a request to return Easysoft XML-ODBC Server configuration details:

<!ELEMENT Request (Configuration)>

<!ELEMENT Configuration EMPTY>

configuration.dtd

Defines BOTH the response to a request for Easysoft XML-ODBC Server configuration details (see config_request.dtd) AND a request to update Easysoft XML-ODBC Server configuration details:

<!ELEMENT Configuration (Port,

ControlPort,

MaxConcurrentConnect,

MaxClientConnect,

Logging,

LogDir,

Flags,

Client*,

ControlClient*)>

<!ELEMENT Port (#PCDATA)>

<!ELEMENT ControlPort (#PCDATA)>

<!ELEMENT MaxConcurrentConnect (#PCDATA)>

<!ELEMENT MaxClientConnect (#PCDATA)>

<!ELEMENT Logging (#PCDATA)>

<!ELEMENT LogDir (#PCDATA)>

<!ELEMENT Flags ((MultiThreaded | MultiProcess),

(EnableControlInterface | DisableControlInterface),

(WaitForChildrenTerminationOnClosedown | IgnoreChildrenOnClosedown),

(KillChildrenOnClosedown | LeaveChildrenOnClosedown),

(ReverseLookup | NoReverseLookup))>

<!ELEMENT MultiThreaded EMPTY>

<!ELEMENT MultiProcess EMPTY>

<!ELEMENT EnableControlInterface EMPTY>

<!ELEMENT DisableControlInterface EMPTY>

<!ELEMENT WaitForChildrenTerminationOnClosedown EMPTY>

<!ELEMENT IgnoreChildrenOnClosedown EMPTY>

<!ELEMENT KillChildrenOnClosedown EMPTY>

<!ELEMENT LeaveChildrenOnClosedown EMPTY>

<!ELEMENT ReverseLookup EMPTY>

<!ELEMENT NoReverseLookup EMPTY>

<!ELEMENT Client (#PCDATA)>

<!ATTLIST Client Allow (Yes | No) #REQUIRED>

<!ELEMENT ControlClient (#PCDATA)>

<!ATTLIST ControlClient Allow (Yes | No) #REQUIRED>

config_response.dtd

Defines the response to a request to update Easysoft XML-ODBC Server configuration details (see configuration.dtd):

<!ELEMENT Result (Diagnostic*) >

<!ATTLIST Result State CDATA #REQUIRED>

<!-- Note that State="00000" for all success cases -->

<!ELEMENT Diagnostic (Text)>

<!ATTLIST Diagnostic Number CDATA #REQUIRED>

<!ELEMENT Text (#PCDATA)>

Statistics

The following DTDs are used to request and receive Easysoft XML-ODBC Server statistics:

stats_request.dtd

Defines a request to return Easysoft XML-ODBC Server statistics:

<!ELEMENT Request (Result)>

<!ELEMENT Result EMPTY>

stats_response.dtd

Defines the response to a request for Easysoft XML-ODBC Server statistics (see stats_request.dtd):

<!ELEMENT Result (UpTime,

CPUTime,

Connections,

Clients+,

Control)>

<!ATTLIST Result State CDATA #REQUIRED>

<!-- Note that State="00000" for all success cases -->

<!ELEMENT UpTime (#PCDATA)>

<!ELEMENT CPUTime (Kernel, User)>

<!ELEMENT Kernel (#PCDATA)>

<!ELEMENT User (#PCDATA)>

<!ELEMENT Connections (Total,

Refused*,

Active*,

MaxConcurrent*,

ChildrenCreated*,

LastConnect*,

LastDisconnect*)>

<!ELEMENT Total (#PCDATA)>

<!ELEMENT Refused (#PCDATA)>

<!ELEMENT Active (#PCDATA)>

<!ELEMENT MaxConcurrent (#PCDATA)>

<!ELEMENT ChildrenCreated (#PCDATA)>

<!ELEMENT LastConnect (#PCDATA)>

<!ELEMENT LastDisconnect (#PCDATA)>

<!ELEMENT Clients (#PCDATA)>

<!ELEMENT Control (Connections)>