* xmlXIncludeGetProp: * @ctxt: the XInclude context * @cur: the node * @name: the attribute name * * Get an XInclude attribute * * Returns the value (to be freed) or NULL if not found */
| 193 | * Returns the value (to be freed) or NULL if not found |
| 194 | */ |
| 195 | static xmlChar * |
| 196 | xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur, |
| 197 | const xmlChar *name) { |
| 198 | xmlChar *ret; |
| 199 | |
| 200 | if (xmlNodeGetAttrValue(cur, name, XINCLUDE_NS, &ret) < 0) |
| 201 | xmlXIncludeErrMemory(ctxt); |
| 202 | if (ret != NULL) |
| 203 | return(ret); |
| 204 | |
| 205 | if (ctxt->legacy != 0) { |
| 206 | if (xmlNodeGetAttrValue(cur, name, XINCLUDE_OLD_NS, &ret) < 0) |
| 207 | xmlXIncludeErrMemory(ctxt); |
| 208 | if (ret != NULL) |
| 209 | return(ret); |
| 210 | } |
| 211 | |
| 212 | if (xmlNodeGetAttrValue(cur, name, NULL, &ret) < 0) |
| 213 | xmlXIncludeErrMemory(ctxt); |
| 214 | return(ret); |
| 215 | } |
| 216 | /** |
| 217 | * xmlXIncludeFreeRef: |
| 218 | * @ref: the XInclude reference |
no test coverage detected