Lines 27391-27396
xmlSchemaSAXHandleStartElementNs(void *ctx,
Link Here
|
27391 |
* attributes yet. |
27391 |
* attributes yet. |
27392 |
*/ |
27392 |
*/ |
27393 |
if (nb_attributes != 0) { |
27393 |
if (nb_attributes != 0) { |
|
|
27394 |
int valueLen, k, l; |
27394 |
xmlChar *value; |
27395 |
xmlChar *value; |
27395 |
|
27396 |
|
27396 |
for (j = 0, i = 0; i < nb_attributes; i++, j += 5) { |
27397 |
for (j = 0, i = 0; i < nb_attributes; i++, j += 5) { |
Lines 27400-27411
xmlSchemaSAXHandleStartElementNs(void *ctx,
Link Here
|
27400 |
* libxml2 differs from normal SAX here in that it escapes all ampersands |
27401 |
* libxml2 differs from normal SAX here in that it escapes all ampersands |
27401 |
* as & instead of delivering the raw converted string. Changing the |
27402 |
* as & instead of delivering the raw converted string. Changing the |
27402 |
* behavior at this point would break applications that use this API, so |
27403 |
* behavior at this point would break applications that use this API, so |
27403 |
* we are forced to work around it. There is no danger of accidentally |
27404 |
* we are forced to work around it. |
27404 |
* decoding some entity other than & in this step because without |
|
|
27405 |
* unescaped ampersands there can be no other entities in the string. |
27406 |
*/ |
27405 |
*/ |
27407 |
value = xmlStringLenDecodeEntities(vctxt->parserCtxt, attributes[j+3], |
27406 |
valueLen = attributes[j+4] - attributes[j+3]; |
27408 |
attributes[j+4] - attributes[j+3], XML_SUBSTITUTE_REF, 0, 0, 0); |
27407 |
value = xmlMallocAtomic(valueLen + 1); |
|
|
27408 |
if (value == NULL) { |
27409 |
xmlSchemaVErrMemory(vctxt, |
27410 |
"allocating string for decoded attribute", |
27411 |
NULL); |
27412 |
goto internal_error; |
27413 |
} |
27414 |
for (k = 0, l = 0; k < valueLen; l++) { |
27415 |
if (k < valueLen - 4 && |
27416 |
attributes[j+3][k+0] == '&' && |
27417 |
attributes[j+3][k+1] == '#' && |
27418 |
attributes[j+3][k+2] == '3' && |
27419 |
attributes[j+3][k+3] == '8' && |
27420 |
attributes[j+3][k+4] == ';') { |
27421 |
value[l] = '&'; |
27422 |
k += 5; |
27423 |
} else { |
27424 |
value[l] = attributes[j+3][k]; |
27425 |
k++; |
27426 |
} |
27427 |
} |
27428 |
value[l] = '\0'; |
27409 |
/* |
27429 |
/* |
27410 |
* TODO: Set the node line. |
27430 |
* TODO: Set the node line. |
27411 |
*/ |
27431 |
*/ |
27412 |
- |
|
|