fred-mod-eppd-2.20.2
Macros | Enumerations | Functions
epp_xmlcommon.h File Reference
#include <libxml/tree.h>
#include <libxml/xmlschemas.h>
Include dependency graph for epp_xmlcommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NS_EPP   "urn:ietf:params:xml:ns:epp-1.0"
 Standard EPP xml namespace.
 
#define NS_CONTACT   "http://www.nic.cz/xml/epp/contact-1.6"
 Our custom namespace used for contact object.
 
#define NS_DOMAIN   "http://www.nic.cz/xml/epp/domain-1.4"
 Our custom namespace used for domain object.
 
#define NS_NSSET   "http://www.nic.cz/xml/epp/nsset-1.2"
 Our custom namespace used for nsset object.
 
#define NS_KEYSET   "http://www.nic.cz/xml/epp/keyset-1.3"
 Our custom namespace used for keyset object.
 
#define NS_FRED   "http://www.nic.cz/xml/epp/fred-1.5"
 Our custom namespace used for extensions definition.
 
#define NS_ENUMVAL   "http://www.nic.cz/xml/epp/enumval-1.2"
 Our custom namespace used for enum validation extension.
 
#define NS_EXTRAADDR   "http://www.nic.cz/xml/epp/extra-addr-1.0"
 Our custom namespace used for extra contact address extension.
 
#define LOC_EPP   NS_EPP " epp-1.0.xsd"
 Namespace + location of epp xml schema.
 
#define LOC_CONTACT   NS_CONTACT " contact-1.6.1.xsd"
 Namespace + location of contact xml schema.
 
#define LOC_DOMAIN   NS_DOMAIN " domain-1.4.1.xsd"
 Namespace + location of domain xml schema.
 
#define LOC_NSSET   NS_NSSET " nsset-1.2.1.xsd"
 Namespace + location of nsset xml schema.
 
#define LOC_KEYSET   NS_KEYSET " keyset-1.3.1.xsd"
 Namespace + location of keyset xml schema.
 
#define LOC_FRED   NS_FRED " fred-1.5.0.xsd"
 Namespace + location of fred xml schema.
 
#define LOC_ENUMVAL   NS_ENUMVAL " enumval-1.2.0.xsd"
 Namespace + location of enumval xml schema.
 
#define LOC_EXTRAADDR   NS_EXTRAADDR " extra-addr-1.0.xsd"
 Namespace + location of extraaddr xml schema.
 

Enumerations

enum  valid_status { VAL_OK, VAL_NOT_VALID, VAL_ESCHEMA, VAL_EINTERNAL }
 Enumaration of statuses returned by validator. More...
 

Functions

valid_status validate_doc (void *pool, xmlSchemaPtr schema, xmlDocPtr doc, qhead *err_list)
 Function for validating xml document. More...
 
char * epp_getSubtree (void *pool, epp_command_data *cdata, const char *xpath_expr, int position)
 Get subtree of XML document based on xpath expression. More...
 

Detailed Description

This file gathers declarations common to both libxml components (parser and generator).

Enumeration Type Documentation

◆ valid_status

Enumaration of statuses returned by validator.

Enumerator
VAL_OK 

Document is valid.

VAL_NOT_VALID 

Document does not validate.

VAL_ESCHEMA 

Error when loading or parsing schema.

VAL_EINTERNAL 

Internal error (malloc failed).

Function Documentation

◆ epp_getSubtree()

char* epp_getSubtree ( void *  pool,
epp_command_data cdata,
const char *  xpath_expr,
int  position 
)

Get subtree of XML document based on xpath expression.

If there is no node matching xpath expression at appropriate position, empty string is returned. In case of internal error NULL is returned.

Parameters
poolPool for memory allocations.
cdataStructure containing xpath context and parsed document.
xpath_exprXPath expression which identifies element.
positionPoradi elementu v mnozine pasujicich elementu.
Returns
String with resulting subtree allocated from pool.

References epp_strdup(), epp_command_data::parsed_doc, and epp_command_data::xpath_ctx.

◆ validate_doc()

valid_status validate_doc ( void *  pool,
xmlSchemaPtr  schema,
xmlDocPtr  doc,
qhead err_list 
)

Function for validating xml document.

Parameters
poolPool to allocate memory from.
schemaSchema used for validation.
docXML document.
err_listInitialized and empty list for storing encountered errors.
Returns
Status.

References valerr_ctx::doc, valerr_ctx::err_list, valerr_ctx::pool, VAL_EINTERNAL, VAL_NOT_VALID, and VAL_OK.

Referenced by epp_parse_command().