* xmlSchematronPushInclude: * @ctxt: the schema parser context * @doc: the included document * @cur: the current include node * * Add an included document */
| 801 | * Add an included document |
| 802 | */ |
| 803 | static void |
| 804 | xmlSchematronPushInclude(xmlSchematronParserCtxtPtr ctxt, |
| 805 | xmlDocPtr doc, xmlNodePtr cur) |
| 806 | { |
| 807 | if (ctxt->includes == NULL) { |
| 808 | ctxt->maxIncludes = 10; |
| 809 | ctxt->includes = (xmlNodePtr *) |
| 810 | xmlMalloc(ctxt->maxIncludes * 2 * sizeof(xmlNodePtr)); |
| 811 | if (ctxt->includes == NULL) { |
| 812 | xmlSchematronPErrMemory(NULL); |
| 813 | return; |
| 814 | } |
| 815 | ctxt->nbIncludes = 0; |
| 816 | } else if (ctxt->nbIncludes + 2 >= ctxt->maxIncludes) { |
| 817 | xmlNodePtr *tmp; |
| 818 | |
| 819 | tmp = (xmlNodePtr *) |
| 820 | xmlRealloc(ctxt->includes, ctxt->maxIncludes * 4 * |
| 821 | sizeof(xmlNodePtr)); |
| 822 | if (tmp == NULL) { |
| 823 | xmlSchematronPErrMemory(NULL); |
| 824 | return; |
| 825 | } |
| 826 | ctxt->includes = tmp; |
| 827 | ctxt->maxIncludes *= 2; |
| 828 | } |
| 829 | ctxt->includes[2 * ctxt->nbIncludes] = cur; |
| 830 | ctxt->includes[2 * ctxt->nbIncludes + 1] = (xmlNodePtr) doc; |
| 831 | ctxt->nbIncludes++; |
| 832 | } |
| 833 | |
| 834 | /** |
| 835 | * xmlSchematronPopInclude: |
no test coverage detected