* xmlTreeEnsureXMLDecl: * @doc: the doc * * Ensures that there is an XML namespace declaration on the doc. * * Returns the XML ns-struct or NULL if a memory allocation failed. */
| 6017 | * Returns the XML ns-struct or NULL if a memory allocation failed. |
| 6018 | */ |
| 6019 | static xmlNsPtr |
| 6020 | xmlTreeEnsureXMLDecl(xmlDocPtr doc) |
| 6021 | { |
| 6022 | xmlNsPtr ns; |
| 6023 | |
| 6024 | ns = doc->oldNs; |
| 6025 | if (ns != NULL) |
| 6026 | return (ns); |
| 6027 | |
| 6028 | ns = xmlNewXmlNs(); |
| 6029 | doc->oldNs = ns; |
| 6030 | |
| 6031 | return(ns); |
| 6032 | } |
| 6033 | |
| 6034 | /** |
| 6035 | * xmlSearchNsSafe: |
no test coverage detected