OLD | NEW |
1 /* | 1 /* |
2 * imports.c: Implementation of the XSLT imports | 2 * imports.c: Implementation of the XSLT imports |
3 * | 3 * |
4 * Reference: | 4 * Reference: |
5 * http://www.w3.org/TR/1999/REC-xslt-19991116 | 5 * http://www.w3.org/TR/1999/REC-xslt-19991116 |
6 * | 6 * |
7 * See Copyright for the status of this software. | 7 * See Copyright for the status of this software. |
8 * | 8 * |
9 * daniel@veillard.com | 9 * daniel@veillard.com |
10 */ | 10 */ |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 xsltTemplatePtr | 393 xsltTemplatePtr |
394 xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name, | 394 xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name, |
395 const xmlChar *nameURI) { | 395 const xmlChar *nameURI) { |
396 xsltTemplatePtr cur; | 396 xsltTemplatePtr cur; |
397 xsltStylesheetPtr style; | 397 xsltStylesheetPtr style; |
398 | 398 |
399 if ((ctxt == NULL) || (name == NULL)) | 399 if ((ctxt == NULL) || (name == NULL)) |
400 return(NULL); | 400 return(NULL); |
401 style = ctxt->style; | 401 style = ctxt->style; |
402 while (style != NULL) { | 402 while (style != NULL) { |
403 » cur = style->templates; | 403 if (style->namedTemplates != NULL) { |
404 » while (cur != NULL) { | 404 cur = (xsltTemplatePtr) |
405 » if (xmlStrEqual(name, cur->name)) { | 405 xmlHashLookup2(style->namedTemplates, name, nameURI); |
406 » » if (((nameURI == NULL) && (cur->nameURI == NULL)) || | 406 if (cur != NULL) |
407 » » ((nameURI != NULL) && (cur->nameURI != NULL) && | 407 return(cur); |
408 » » (xmlStrEqual(nameURI, cur->nameURI)))) { | 408 } |
409 » » return(cur); | |
410 » » } | |
411 » } | |
412 » cur = cur->next; | |
413 » } | |
414 | 409 |
415 style = xsltNextImport(style); | 410 style = xsltNextImport(style); |
416 } | 411 } |
417 return(NULL); | 412 return(NULL); |
418 } | 413 } |
419 | 414 |
OLD | NEW |