* xmlExpandEntitiesInAttValue: * @ctxt: parser context * @str: entity or attribute value * @normalize: whether to collapse whitespace * * Expand general entity references in an entity or attribute value. * Perform attribute value normalization. * * Returns the expanded attribtue value. */
| 4247 | * Returns the expanded attribtue value. |
| 4248 | */ |
| 4249 | xmlChar * |
| 4250 | xmlExpandEntitiesInAttValue(xmlParserCtxtPtr ctxt, const xmlChar *str, |
| 4251 | int normalize) { |
| 4252 | unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ? |
| 4253 | XML_MAX_HUGE_LENGTH : |
| 4254 | XML_MAX_TEXT_LENGTH; |
| 4255 | xmlSBuf buf; |
| 4256 | int inSpace = 1; |
| 4257 | |
| 4258 | xmlSBufInit(&buf, maxLength); |
| 4259 | |
| 4260 | xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace, |
| 4261 | ctxt->inputNr, /* check */ 0); |
| 4262 | |
| 4263 | if ((normalize) && (inSpace) && (buf.size > 0)) |
| 4264 | buf.size--; |
| 4265 | |
| 4266 | return(xmlSBufFinish(&buf, NULL, ctxt, "AttValue length too long")); |
| 4267 | } |
| 4268 | |
| 4269 | /** |
| 4270 | * xmlParseAttValueInternal: |
no test coverage detected