OLD | NEW |
1 /* | 1 /* |
2 * namespaces.c: Implementation of the XSLT namespaces handling | 2 * namespaces.c: Implementation of the XSLT namespaces handling |
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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 } | 783 } |
784 #else | 784 #else |
785 /* | 785 /* |
786 * TODO: Remove this if the refactored code gets enabled. | 786 * TODO: Remove this if the refactored code gets enabled. |
787 */ | 787 */ |
788 if (!xmlStrEqual(cur->href, XSLT_NAMESPACE)) { | 788 if (!xmlStrEqual(cur->href, XSLT_NAMESPACE)) { |
789 const xmlChar *URI; | 789 const xmlChar *URI; |
790 /* TODO apply cascading */ | 790 /* TODO apply cascading */ |
791 URI = (const xmlChar *) xmlHashLookup(ctxt->style->nsAliases, | 791 URI = (const xmlChar *) xmlHashLookup(ctxt->style->nsAliases, |
792 cur->href); | 792 cur->href); |
793 » if (URI == UNDEFINED_DEFAULT_NS) | 793 » if (URI == UNDEFINED_DEFAULT_NS) { |
| 794 » » cur = cur->next; |
794 continue; | 795 continue; |
| 796 } |
795 if (URI != NULL) { | 797 if (URI != NULL) { |
796 q = xmlNewNs(node, URI, cur->prefix); | 798 q = xmlNewNs(node, URI, cur->prefix); |
797 } else { | 799 } else { |
798 q = xmlNewNs(node, cur->href, cur->prefix); | 800 q = xmlNewNs(node, cur->href, cur->prefix); |
799 } | 801 } |
800 if (p == NULL) { | 802 if (p == NULL) { |
801 ret = p = q; | 803 ret = p = q; |
802 } else { | 804 } else { |
803 p->next = q; | 805 p->next = q; |
804 p = q; | 806 p = q; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 * @style: an XSLT stylesheet | 844 * @style: an XSLT stylesheet |
843 * | 845 * |
844 * Free up the memory used by namespaces aliases | 846 * Free up the memory used by namespaces aliases |
845 */ | 847 */ |
846 void | 848 void |
847 xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style) { | 849 xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style) { |
848 if (style->nsAliases != NULL) | 850 if (style->nsAliases != NULL) |
849 xmlHashFree((xmlHashTablePtr) style->nsAliases, NULL); | 851 xmlHashFree((xmlHashTablePtr) style->nsAliases, NULL); |
850 style->nsAliases = NULL; | 852 style->nsAliases = NULL; |
851 } | 853 } |
OLD | NEW |