* xmlNodeListGetString: * @doc: a document (optional) * @list: a node list of attribute children * @inLine: whether entity references are substituted * * Serializes attribute children (text and entity reference nodes) * into a string. * * If @inLine is true, entity references will be substituted. * Otherwise, entity references will be kept and special characters * like '&' as well as
| 1608 | * Returns a string or NULL if a memory allocation failed. |
| 1609 | */ |
| 1610 | xmlChar * |
| 1611 | xmlNodeListGetString(xmlDocPtr doc, const xmlNode *list, int inLine) |
| 1612 | { |
| 1613 | int escMode; |
| 1614 | |
| 1615 | /* backward compatibility */ |
| 1616 | if (list == NULL) |
| 1617 | return(NULL); |
| 1618 | |
| 1619 | if (inLine) { |
| 1620 | escMode = 0; |
| 1621 | } else { |
| 1622 | if ((list->parent != NULL) && |
| 1623 | (list->parent->type == XML_ATTRIBUTE_NODE)) |
| 1624 | escMode = 2; |
| 1625 | else |
| 1626 | escMode = 1; |
| 1627 | } |
| 1628 | |
| 1629 | return(xmlNodeListGetStringInternal(doc, list, escMode)); |
| 1630 | } |
| 1631 | |
| 1632 | #ifdef LIBXML_TREE_ENABLED |
| 1633 | /** |
no test coverage detected