# XML Templates
**API Group:** `xmlsec_core_templates`
Functions for creating XMLDSig and XMLEnc XML template documents.
XML signature and encryption template functions.
## Functions
### `xmlSecTmplSignatureCreate`
```c
xmlNodePtr xmlSecTmplSignatureCreate(xmlDocPtr doc, xmlSecTransformId c14nMethodId, xmlSecTransformId signMethodId, const xmlChar *id);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L26)
Creates a new node with required children.
Creates new node with the mandatory , , and children and sub-children. The application is responsible for inserting the returned node in the XML document.
**Parameters:**
- `doc` — the pointer to signature document or NULL; in the second case, application must later call xmlSetTreeDoc to ensure that all the children nodes have correct pointer to XML document.
- `c14nMethodId` — the signature canonicalization method.
- `signMethodId` — the signature method.
- `id` — the node id (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplSignatureCreateNsPref`
```c
xmlNodePtr xmlSecTmplSignatureCreateNsPref(xmlDocPtr doc, xmlSecTransformId c14nMethodId, xmlSecTransformId signMethodId, const xmlChar *id, const xmlChar *nsPrefix);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L30)
Creates a new node with a custom namespace prefix.
Creates new node with the mandatory , , and children and sub-children. This method differs from xmlSecTmplSignatureCreate in that it will define the [http://www.w3.org/2000/09/xmldsig#](http://www.w3.org/2000/09/xmldsig#) namespace with the given prefix that will be used for all of the appropriate child nodes. The application is responsible for inserting the returned node in the XML document.
**Parameters:**
- `doc` — the pointer to signature document or NULL; in the second case, application must later call xmlSetTreeDoc to ensure that all the children nodes have correct pointer to XML document.
- `c14nMethodId` — the signature canonicalization method.
- `signMethodId` — the signature method.
- `id` — the node id (may be NULL).
- `nsPrefix` — the namespace prefix for the signature element (e.g. "dsig"), or NULL
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplSignatureEnsureKeyInfo`
```c
xmlNodePtr xmlSecTmplSignatureEnsureKeyInfo(xmlNodePtr signNode, const xmlChar *id);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L35)
Ensures a child node in the node.
Adds (if necessary) node to the node `signNode`.
**Parameters:**
- `signNode` — the pointer to node.
- `id` — the node id (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplSignatureAddReference`
```c
xmlNodePtr xmlSecTmplSignatureAddReference(xmlNodePtr signNode, xmlSecTransformId digestMethodId, const xmlChar *id, const xmlChar *uri, const xmlChar *type);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L37)
Adds a node to the child.
Adds node with given URI (`uri`), Id (`id`) and Type (`type`) attributes and the required children and to the child of `signNode`.
**Parameters:**
- `signNode` — the pointer to node.
- `digestMethodId` — the reference digest method.
- `id` — the node id (may be NULL).
- `uri` — the reference node uri (may be NULL).
- `type` — the reference node type (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplSignatureAddObject`
```c
xmlNodePtr xmlSecTmplSignatureAddObject(xmlNodePtr signNode, const xmlChar *id, const xmlChar *mimeType, const xmlChar *encoding);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L42)
Adds a node to the node.
Adds node to the node `signNode`.
**Parameters:**
- `signNode` — the pointer to node.
- `id` — the node id (may be NULL).
- `mimeType` — the object mime type (may be NULL).
- `encoding` — the object encoding (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplSignatureGetSignMethodNode`
```c
xmlNodePtr xmlSecTmplSignatureGetSignMethodNode(xmlNodePtr signNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L46)
Gets the child of node.
Gets pointer to child of node.
**Parameters:**
- `signNode` — the pointer to node.
**Returns:** pointer to node or NULL if an error occurs.
---
### `xmlSecTmplSignatureGetC14NMethodNode`
```c
xmlNodePtr xmlSecTmplSignatureGetC14NMethodNode(xmlNodePtr signNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L47)
Gets the child of node.
Gets pointer to child of node.
**Parameters:**
- `signNode` — the pointer to node.
**Returns:** pointer to node or NULL if an error occurs.
---
### `xmlSecTmplReferenceAddTransform`
```c
xmlNodePtr xmlSecTmplReferenceAddTransform(xmlNodePtr referenceNode, xmlSecTransformId transformId);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L49)
Adds a node to the node.
Adds node to the node `referenceNode`.
**Parameters:**
- `referenceNode` — the pointer to node.
- `transformId` — the transform method id.
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplObjectAddSignProperties`
```c
xmlNodePtr xmlSecTmplObjectAddSignProperties(xmlNodePtr objectNode, const xmlChar *id, const xmlChar *target);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L51)
Adds a node to the node.
Adds node to the node `objectNode`.
**Parameters:**
- `objectNode` — the pointer to node.
- `id` — the node id (may be NULL).
- `target` — the Target (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplObjectAddManifest`
```c
xmlNodePtr xmlSecTmplObjectAddManifest(xmlNodePtr objectNode, const xmlChar *id);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L54)
Adds a node to the node.
Adds node to the node `objectNode`.
**Parameters:**
- `objectNode` — the pointer to node.
- `id` — the node id (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplManifestAddReference`
```c
xmlNodePtr xmlSecTmplManifestAddReference(xmlNodePtr manifestNode, xmlSecTransformId digestMethodId, const xmlChar *id, const xmlChar *uri, const xmlChar *type);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L56)
Adds a node to the node.
Adds node with specified URI (`uri`), Id (`id`) and Type (`type`) attributes and the required children and to the node `manifestNode`.
**Parameters:**
- `manifestNode` — the pointer to node.
- `digestMethodId` — the reference digest method.
- `id` — the node id (may be NULL).
- `uri` — the reference node uri (may be NULL).
- `type` — the reference node type (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataCreate`
```c
xmlNodePtr xmlSecTmplEncDataCreate(xmlDocPtr doc, xmlSecTransformId encMethodId, const xmlChar *id, const xmlChar *type, const xmlChar *mimeType, const xmlChar *encoding);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L67)
Creates a new node for encryption template.
Creates new node for encryption template.
**Parameters:**
- `doc` — the pointer to signature document or NULL; in the later case, application must later call xmlSetTreeDoc to ensure that all the children nodes have correct pointer to XML document.
- `encMethodId` — the encryption method (may be NULL).
- `id` — the Id attribute (optional).
- `type` — the Type attribute (optional)
- `mimeType` — the MimeType attribute (optional)
- `encoding` — the Encoding attribute (optional)
**Returns:** the pointer newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataEnsureKeyInfo`
```c
xmlNodePtr xmlSecTmplEncDataEnsureKeyInfo(xmlNodePtr encNode, const xmlChar *id);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L73)
Ensures a child in the node.
Adds to the node `encNode`.
**Parameters:**
- `encNode` — the pointer to node.
- `id` — the Id attrbibute (optional).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataEnsureEncProperties`
```c
xmlNodePtr xmlSecTmplEncDataEnsureEncProperties(xmlNodePtr encNode, const xmlChar *id);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L75)
Ensures a child in the node.
Adds node to the node `encNode`.
**Parameters:**
- `encNode` — the pointer to node.
- `id` — the Id attribute (optional).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataAddEncProperty`
```c
xmlNodePtr xmlSecTmplEncDataAddEncProperty(xmlNodePtr encNode, const xmlChar *id, const xmlChar *target);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L77)
Adds a node to the node.
Adds node (and the parent node if required) to the node `encNode`.
**Parameters:**
- `encNode` — the pointer to node.
- `id` — the Id attribute (optional).
- `target` — the Target attribute (optional).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataEnsureCipherValue`
```c
xmlNodePtr xmlSecTmplEncDataEnsureCipherValue(xmlNodePtr encNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L80)
Ensures a child in the node.
Adds to the node `encNode`.
**Parameters:**
- `encNode` — the pointer to node.
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataEnsureCipherReference`
```c
xmlNodePtr xmlSecTmplEncDataEnsureCipherReference(xmlNodePtr encNode, const xmlChar *uri);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L81)
Ensures a child in the node.
Adds node with specified URI attribute `uri` to the node `encNode`.
**Parameters:**
- `encNode` — the pointer to node.
- `uri` — the URI attribute (may be NULL).
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplEncDataGetEncMethodNode`
```c
xmlNodePtr xmlSecTmplEncDataGetEncMethodNode(xmlNodePtr encNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L83)
Gets pointer to node.
**Parameters:**
- `encNode` — the pointer to node.
**Returns:** pointer to node or NULL if an error occurs.
---
### `xmlSecTmplCipherReferenceAddTransform`
```c
xmlNodePtr xmlSecTmplCipherReferenceAddTransform(xmlNodePtr cipherReferenceNode, xmlSecTransformId transformId);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L84)
Adds a node to the node.
Adds node (and the parent node) with specified transform methods `transform` to the child node of the node `encNode`.
**Parameters:**
- `cipherReferenceNode` — the pointer to node.
- `transformId` — the transform id.
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplReferenceListAddDataReference`
```c
xmlNodePtr xmlSecTmplReferenceListAddDataReference(xmlNodePtr encNode, const xmlChar *uri);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L92)
Adds a node to the node.
Adds and the parent node (if needed).
**Parameters:**
- `encNode` — the pointer to node.
- `uri` — uri to reference (optional)
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplReferenceListAddKeyReference`
```c
xmlNodePtr xmlSecTmplReferenceListAddKeyReference(xmlNodePtr encNode, const xmlChar *uri);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L94)
Adds a node to the node.
Adds and the parent node (if needed).
**Parameters:**
- `encNode` — the pointer to node.
- `uri` — uri to reference (optional)
**Returns:** the pointer to newly created node or NULL if an error occurs.
---
### `xmlSecTmplKeyInfoAddKeyName`
```c
xmlNodePtr xmlSecTmplKeyInfoAddKeyName(xmlNodePtr keyInfoNode, const xmlChar *name);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L102)
Adds a node to the node.
Adds node to the node `keyInfoNode`.
**Parameters:**
- `keyInfoNode` — the pointer to node.
- `name` — the key name (optional).
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplKeyInfoAddKeyValue`
```c
xmlNodePtr xmlSecTmplKeyInfoAddKeyValue(xmlNodePtr keyInfoNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L104)
Adds a node to the node.
Adds node to the node `keyInfoNode`.
**Parameters:**
- `keyInfoNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplKeyInfoAddX509Data`
```c
xmlNodePtr xmlSecTmplKeyInfoAddX509Data(xmlNodePtr keyInfoNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L105)
Adds a node to the node.
Adds node to the node `keyInfoNode`.
**Parameters:**
- `keyInfoNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplKeyInfoAddRetrievalMethod`
```c
xmlNodePtr xmlSecTmplKeyInfoAddRetrievalMethod(xmlNodePtr keyInfoNode, const xmlChar *uri, const xmlChar *type);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L106)
Adds a node to the node.
Adds node to the node `keyInfoNode`.
**Parameters:**
- `keyInfoNode` — the pointer to node.
- `uri` — the URI attribute (optional).
- `type` — the Type attribute(optional).
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplRetrievalMethodAddTransform`
```c
xmlNodePtr xmlSecTmplRetrievalMethodAddTransform(xmlNodePtr retrMethodNode, xmlSecTransformId transformId);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L109)
Adds a node to the node.
Adds node (and the parent node if required) to the node `retrMethod`.
**Parameters:**
- `retrMethodNode` — the pointer to node.
- `transformId` — the transform id.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplKeyInfoAddEncryptedKey`
```c
xmlNodePtr xmlSecTmplKeyInfoAddEncryptedKey(xmlNodePtr keyInfoNode, xmlSecTransformId encMethodId, const xmlChar *id, const xmlChar *type, const xmlChar *recipient);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L111)
Adds a node to the node.
Adds node with given attributes to the node `keyInfoNode`.
**Parameters:**
- `keyInfoNode` — the pointer to node.
- `encMethodId` — the encryption method (optional).
- `id` — the Id attribute (optional).
- `type` — the Type attribute (optional).
- `recipient` — the Recipient attribute (optional).
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddIssuerSerial`
```c
xmlNodePtr xmlSecTmplX509DataAddIssuerSerial(xmlNodePtr x509DataNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L122)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509IssuerSerialAddIssuerName`
```c
xmlNodePtr xmlSecTmplX509IssuerSerialAddIssuerName(xmlNodePtr x509IssuerSerialNode, const xmlChar *issuerName);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L123)
Adds a node to the node.
Adds node to the node `x509IssuerSerialNode`.
**Parameters:**
- `x509IssuerSerialNode` — the pointer to node.
- `issuerName` — the issuer name (optional).
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509IssuerSerialAddSerialNumber`
```c
xmlNodePtr xmlSecTmplX509IssuerSerialAddSerialNumber(xmlNodePtr x509IssuerSerialNode, const xmlChar *serial);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L124)
Adds a node to the node.
Adds node to the node `x509IssuerSerialNode`.
**Parameters:**
- `x509IssuerSerialNode` — the pointer to node.
- `serial` — the serial number (optional).
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddSubjectName`
```c
xmlNodePtr xmlSecTmplX509DataAddSubjectName(xmlNodePtr x509DataNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L125)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddSKI`
```c
xmlNodePtr xmlSecTmplX509DataAddSKI(xmlNodePtr x509DataNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L126)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddDigest`
```c
xmlNodePtr xmlSecTmplX509DataAddDigest(xmlNodePtr x509DataNode, const xmlChar *digestAlgorithm);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L127)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
- `digestAlgorithm` — the digest algorithm URL.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddCertificate`
```c
xmlNodePtr xmlSecTmplX509DataAddCertificate(xmlNodePtr x509DataNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L128)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplX509DataAddCRL`
```c
xmlNodePtr xmlSecTmplX509DataAddCRL(xmlNodePtr x509DataNode);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L129)
Adds a node to the node.
Adds node to the given node.
**Parameters:**
- `x509DataNode` — the pointer to node.
**Returns:** the pointer to the newly created node or NULL if an error occurs.
---
### `xmlSecTmplTransformAddHmacOutputLength`
```c
int xmlSecTmplTransformAddHmacOutputLength(xmlNodePtr transformNode, xmlSecSize bitsLen);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L136)
Creates a child for the HMAC transform node.
Creates child for the HMAC transform node `node`.
**Parameters:**
- `transformNode` — the pointer to node
- `bitsLen` — the required length in bits
**Returns:** 0 on success and a negative value otherwise.
---
### `xmlSecTmplTransformAddRsaOaepParam`
```c
int xmlSecTmplTransformAddRsaOaepParam(xmlNodePtr transformNode, const xmlSecByte *buf, xmlSecSize size);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L138)
Creates a child node in the `node`.
Creates child node in the `node`.
**Parameters:**
- `transformNode` — the pointer to node.
- `buf` — the OAEP param buffer.
- `size` — the OAEP param buffer size.
**Returns:** 0 on success or a negative value if an error occurs.
---
### `xmlSecTmplTransformAddRsaMgf`
```c
int xmlSecTmplTransformAddRsaMgf(xmlNodePtr transformNode, const xmlChar *algorithm);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L141)
Creates child node in the `node`.
**Parameters:**
- `transformNode` — the pointer to node.
- `algorithm` — MGF1 algorithm href.
**Returns:** 0 on success or a negative value if an error occurs.
---
### `xmlSecTmplTransformAddRsaDigest`
```c
int xmlSecTmplTransformAddRsaDigest(xmlNodePtr transformNode, const xmlChar *algorithm);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L143)
Creates a child node in the `node`.
Creates child node in the `node`.
**Parameters:**
- `transformNode` — the pointer to node.
- `algorithm` — digest algorithm href.
**Returns:** 0 on success or a negative value if an error occurs.
---
### `xmlSecTmplTransformAddXsltStylesheet`
```c
int xmlSecTmplTransformAddXsltStylesheet(xmlNodePtr transformNode, const xmlChar *xslt);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L145)
Writes an XSLT transform expression to the node.
Writes the XSLT transform expression to the `node`.
**Parameters:**
- `transformNode` — the pointer to node.
- `xslt` — the XSLT transform expression.
**Returns:** 0 on success or a negative value otherwise.
---
### `xmlSecTmplTransformAddC14NInclNamespaces`
```c
int xmlSecTmplTransformAddC14NInclNamespaces(xmlNodePtr transformNode, const xmlChar *prefixList);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L147)
Adds inclusive namespaces to the ExcC14N transform node.
Adds "inclusive" namespaces to the ExcC14N transform node `node`.
**Parameters:**
- `transformNode` — the pointer to node.
- `prefixList` — the white space delimited list of namespace prefixes, where "#default" indicates the default namespace (optional).
**Returns:** 0 if success or a negative value otherwise.
---
### `xmlSecTmplTransformAddXPath`
```c
int xmlSecTmplTransformAddXPath(xmlNodePtr transformNode, const xmlChar *expression, const xmlChar **nsList);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L149)
Writes XPath transform information to the node.
Writes XPath transform information to the node `node`.
**Parameters:**
- `transformNode` — the pointer to the node.
- `expression` — the XPath expression.
- `nsList` — the NULL terminated list of namespace prefix/href pairs (optional).
**Returns:** 0 for success or a negative value otherwise.
---
### `xmlSecTmplTransformAddXPath2`
```c
int xmlSecTmplTransformAddXPath2(xmlNodePtr transformNode, const xmlChar *type, const xmlChar *expression, const xmlChar **nsList);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L152)
Writes XPath2 transform information to the node.
Writes XPath2 transform information to the node `node`.
**Parameters:**
- `transformNode` — the pointer to the node.
- `type` — the XPath2 transform type ("union", "intersect" or "subtract").
- `expression` — the XPath expression.
- `nsList` — the NULL terminated list of namespace prefix/href pairs. (optional).
**Returns:** 0 for success or a negative value otherwise.
---
### `xmlSecTmplTransformAddXPointer`
```c
int xmlSecTmplTransformAddXPointer(xmlNodePtr transformNode, const xmlChar *expression, const xmlChar **nsList);
```
*Source:* [include/xmlsec/templates.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/templates.h#L156)
Writes XPointer transform information to the node.
Writes XPointer transform information to the node `node`.
**Parameters:**
- `transformNode` — the pointer to the node.
- `expression` — the XPath expression.
- `nsList` — the NULL terminated list of namespace prefix/href pairs. (optional).
**Returns:** 0 for success or a negative value otherwise.
---