Home | Documentation |
XML namespace tables
updated Tue Aug 27 2024 by Robert van Engelen
|
This module defines the Namespace
XML namespace structure and function to activate a table.
More...
Classes | |
struct | Namespace |
Structure of each row in a namespace table. More... | |
Functions | |
int | soap_set_namespaces (struct soap *soap, const struct Namespace *namespaces) |
Activates an XML namespace table to generate and resolve xmlns namespace prefixes in XML messages. More... | |
Variables | |
struct Namespace | namespaces [] |
The global XML namespaces table with entries defined by the Namespace structure and populated in an .nsmap file generated by soapcpp2. More... | |
This module defines the Namespace
XML namespace structure and function to activate a table.
Activates an XML namespace table to generate and resolve xmlns namespace prefixes in XML messages.
This function sets the XML namespace table to be used by the engine to generate and resolve xmlns namespace prefixes in XML messages. Different tables can be set at any time, depending on the XML messaging requirements. However, XML generation and parsing may fail if prefix-URI bindings are missing in the table. Tables are generated by soapcpp2 in .nsmap files, which defines a global table namespaces
that is used by default by the engines, but can be replaced by the XML namespace table specified with this function. Returns SOAP_OK
or a soap_status
error code.
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 -
.
SOAP_OK
or a soap_status
error code soap | soap context |
namespaces | the XML namespace table to activate |
struct Namespace namespaces[] |
The global XML namespaces table with entries defined by the Namespace
structure and populated in an .nsmap file generated by soapcpp2.
This XML namespaces table defines XML namespace prefix-URI pairs for XML generation, parsing and validation. The last row in the table must be followed by a row with a NULL value to indicate the end of the table. The requirement to link this global table can be removed at compile time with WITH_NONAMESPACES
.