|  | Home | Documentation | Namespace Struct Reference updated Thu Mar 9 2023 by Robert van Engelen |

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Members

Public Attributes | List of all members
Namespace Struct Reference
XML namespace tables

Structure of each row in a namespace table. More...

## Public Attributes
const char * | id
| XML namespace prefix identifier string, use NULL to indicate the end of the namespaces table. More...
const char * | ns
| XML namespace URI string. More...
const char * | in
| an optional XML namespace URI string pattern (`*` is a wildcard string and `-` is a wildcard character) that is permitted to match a parsed URI in place of the first URI, or NULL when not applicable More...
char * | out
| Reserved for internal use by the engine only, to switch between URIs such as SOAP 1.1 and 1.2 namespaces based on the URI string pattern when provided in the table. More...

## Detailed Description

Structure of each row in a namespace table.

XML namespaces tables define XML namespace prefix-URI pairs for XML generation, parsing and validation. Each row in the table is defined by this structure. The last row in the table must be followed by a row with a NULL value to indicate the end of the table. The first four rows are reserved for the namespaces of `SOAP-ENV`, `SOAP-ENC`, `xsi` and `xsd`. One or more of these entries can be omitted by using `""` in the first column for the prefix, but beware that XML generation and parsing may fail when an omitted namespace prefix or URI is still used in the XML text.

This structure defines the rows the namespace table `namespaces` and the namespace table parameter of `soap_set_namespaces`.

Example:

#include "soapH.h"
struct Namespace namespaces[] = {
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*XMLSchema", NULL},
{"ns", "http://tempuri.org/ns.xsd", NULL, NULL},
{NULL, NULL, NULL, NULL}
};

This example defines SOAP 1.1 namespaces (`SOAP-ENV` and `SOAP-ENC`) to be used by default, but also accepts SOAP 1.2 because of the second URI in the third column. XML schema instance namespace `xsi` is used with `xsi:type` and `xsi:nil` and the XML schema namespace `xsd` is used with XSD types such as `xsd:string`, which may be used in XML messages. URI patterns in the third column may contain wildcard strings `*` and wildcard characters `-`.

## Member Data Documentation

const char* Namespace::id

XML namespace prefix identifier string, use NULL to indicate the end of the namespaces table.

const char* Namespace::in

an optional XML namespace URI string pattern (`*` is a wildcard string and `-` is a wildcard character) that is permitted to match a parsed URI in place of the first URI, or NULL when not applicable

const char* Namespace::ns

XML namespace URI string.

char* Namespace::out

Reserved for internal use by the engine only, to switch between URIs such as SOAP 1.1 and 1.2 namespaces based on the URI string pattern when provided in the table.