Constructor
new XML_ADAPTER(optionsopt)
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} | Configurable options for XML adapter Properties
|
- Source:
Extends
- JSON_Adapter
Methods
error(erropt, optionsopt, cbopt) → {*}
Creates a formatted XML error response
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
* |
<optional> |
{} | Any data that should be sent with the error response |
|||||||||||||||||||||||||
options |
Object |
<optional> |
{} | Configurable options for the XML error response formatting see _ERROR for more details Properties
|
|||||||||||||||||||||||||
cb |
function |
<optional> |
false | Optional callback function. If argument is not a function it will be ignored |
- Source:
Returns:
Returns the formatted XML string if options.sync is true or a Promise if cb arugement is not passed
- Type
- *
render(data, optionsopt, cbopt) → {*}
Creates a formatted XML response
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
* | Any data that should be sent with the success response |
||||||||||||
options |
Object |
<optional> |
{} | Configurable options for the XML success response formatting see _RENDER for more details Properties
|
||||||||||
cb |
function |
<optional> |
false | Optional callback function. If argument is not a function it will be ignored |
||||||||||
options.req |
Object |
<optional> |
Express request object. If options.req and options.res are defined the express .render method will be used to render template |
|||||||||||
options.res |
Object |
<optional> |
Express response object. If options.res and options.req are defined the express .render method will be used to render template |
|||||||||||
options.skip_response |
Boolean |
<optional> |
If true function will resolve with the rendered template instead of sending a response |
- Source:
Returns:
Returns the formatted XML string if options.sync is true or a Promise if cb arugement is not passed
- Type
- *