Home | History | Annotate | Download | only in libxml2

Lines Matching refs:cur

1598     xmlNodePtr root, cur;
1704 cur = node->children;
1705 while (cur != NULL) {
1706 if (IS_RELAXNG(cur, "start")) {
1716 } else if (IS_RELAXNG(cur, "define")) {
1719 name = xmlGetProp(cur, BAD_CAST "name");
1738 cur = cur->next;
1762 xmlRelaxNGValidErrorPtr cur;
1797 cur = &ctxt->errTab[ctxt->errNr];
1798 cur->err = err;
1800 cur->arg1 = xmlStrdup(arg1);
1801 cur->arg2 = xmlStrdup(arg2);
1802 cur->flags = ERROR_IS_DUP;
1804 cur->arg1 = arg1;
1805 cur->arg2 = arg2;
1806 cur->flags = 0;
1809 cur->node = ctxt->state->node;
1810 cur->seq = ctxt->state->seq;
1812 cur->node = NULL;
1813 cur->seq = NULL;
1815 ctxt->err = cur;
1828 xmlRelaxNGValidErrorPtr cur;
1839 cur = &ctxt->errTab[ctxt->errNr];
1840 if (cur->flags & ERROR_IS_DUP) {
1841 if (cur->arg1 != NULL)
1842 xmlFree((xmlChar *) cur->arg1);
1843 cur->arg1 = NULL;
1844 if (cur->arg2 != NULL)
1845 xmlFree((xmlChar *) cur->arg2);
1846 cur->arg2 = NULL;
1847 cur->flags = 0;
3877 xmlRelaxNGDefinePtr parent, cur, tmp;
3887 cur = def;
3888 while (cur != NULL) {
3889 if ((cur->type == XML_RELAXNG_ELEMENT) ||
3890 (cur->type == XML_RELAXNG_TEXT) ||
3891 (cur->type == XML_RELAXNG_DATATYPE) ||
3892 (cur->type == XML_RELAXNG_PARAM) ||
3893 (cur->type == XML_RELAXNG_LIST) ||
3894 (cur->type == XML_RELAXNG_VALUE) ||
3895 (cur->type == XML_RELAXNG_EMPTY))
3897 if ((cur->type == XML_RELAXNG_CHOICE) ||
3898 (cur->type == XML_RELAXNG_INTERLEAVE) ||
3899 (cur->type == XML_RELAXNG_GROUP) ||
3900 (cur->type == XML_RELAXNG_ONEORMORE) ||
3901 (cur->type == XML_RELAXNG_ZEROORMORE) ||
3902 (cur->type == XML_RELAXNG_OPTIONAL) ||
3903 (cur->type == XML_RELAXNG_PARENTREF) ||
3904 (cur->type == XML_RELAXNG_EXTERNALREF) ||
3905 (cur->type == XML_RELAXNG_REF) ||
3906 (cur->type == XML_RELAXNG_DEF)) {
3907 if (cur->content != NULL) {
3908 parent = cur;
3909 cur = cur->content;
3910 tmp = cur;
3918 if (cur == def)
3920 if (cur->next != NULL) {
3921 cur = cur->next;
3925 cur = cur->parent;
3926 if (cur == NULL)
3928 if (cur == def)
3930 if (cur->next != NULL) {
3931 cur = cur->next;
3934 } while (cur != NULL);
3953 xmlRelaxNGDefinePtr *ret = NULL, parent, cur, tmp;
3965 cur = def;
3966 while (cur != NULL) {
3967 if (((eora == 0) && ((cur->type == XML_RELAXNG_ELEMENT) ||
3968 (cur->type == XML_RELAXNG_TEXT))) ||
3969 ((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE))) {
3991 ret[len++] = cur;
3993 } else if ((cur->type == XML_RELAXNG_CHOICE) ||
3994 (cur->type == XML_RELAXNG_INTERLEAVE) ||
3995 (cur->type == XML_RELAXNG_GROUP) ||
3996 (cur->type == XML_RELAXNG_ONEORMORE) ||
3997 (cur->type == XML_RELAXNG_ZEROORMORE) ||
3998 (cur->type == XML_RELAXNG_OPTIONAL) ||
3999 (cur->type == XML_RELAXNG_PARENTREF) ||
4000 (cur->type == XML_RELAXNG_REF) ||
4001 (cur->type == XML_RELAXNG_DEF) ||
4002 (cur->type == XML_RELAXNG_EXTERNALREF)) {
4007 if (cur->content != NULL) {
4008 parent = cur;
4009 cur = cur->content;
4010 tmp = cur;
4018 if (cur == def)
4020 if (cur->next != NULL) {
4021 cur = cur->next;
4025 cur = cur->parent;
4026 if (cur == NULL)
4028 if (cur == def)
4030 if (cur->next != NULL) {
4031 cur = cur->next;
4034 } while (cur != NULL);
4051 xmlRelaxNGDefinePtr cur;
4073 cur = def->content;
4074 while (cur != NULL) {
4076 cur = cur->next;
4095 cur = def->content;
4096 while (cur != NULL) {
4097 list[i] = xmlRelaxNGGetElements(ctxt, cur, 0);
4109 (void *) cur);
4117 (void *) cur);
4121 (void *) cur);
4128 (void *) cur);
4132 (void *) cur);
4142 cur = cur->next;
4187 xmlRelaxNGDefinePtr cur;
4205 cur = def->attrs;
4206 while (cur != NULL) {
4208 cur = cur->next;
4210 cur = def->content;
4211 while (cur != NULL) {
4213 cur = cur->next;
4224 cur = def->attrs;
4225 while (cur != NULL) {
4226 list[i] = xmlRelaxNGGetElements(ctxt, cur, 1);
4228 cur = cur->next;
4230 cur = def->content;
4231 while (cur != NULL) {
4232 list[i] = xmlRelaxNGGetElements(ctxt, cur, 1);
4234 cur = cur->next;
4279 xmlRelaxNGDefinePtr cur, *tmp;
4301 cur = def->content;
4302 while (cur != NULL) {
4304 cur = cur->next;
4314 cur = def->content;
4315 while (cur != NULL) {
4320 if (cur->type == XML_RELAXNG_TEXT)
4322 groups[nbgroups]->rule = cur;
4323 groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 0);
4324 groups[nbgroups]->attrs = xmlRelaxNGGetElements(ctxt, cur, 1);
4326 cur = cur->next;
4447 xmlRelaxNGDefinePtr last = NULL, cur;
4477 cur = xmlRelaxNGParseElement(ctxt, child);
4479 cur = xmlRelaxNGParsePattern(ctxt, child);
4481 if (cur != NULL) {
4482 cur->parent = def;
4484 def->content = last = cur;
4486 last->next = cur;
4487 last = cur;
5014 xmlRelaxNGDefinePtr ret, cur;
5032 cur = xmlRelaxNGParseNameClass(ctxt, child, ret);
5033 if (cur != NULL)
5037 cur = xmlRelaxNGParsePattern(ctxt, child);
5038 if (cur != NULL) {
5039 switch (cur->type) {
5058 ret->content = cur;
5059 cur->parent = ret;
5099 xmlRelaxNGDefinePtr ret, cur, last = NULL;
5124 cur = xmlRelaxNGNewDefine(ctxt, child);
5125 if (cur == NULL)
5128 cur->type = XML_RELAXNG_ATTRIBUTE;
5130 cur->type = XML_RELAXNG_ELEMENT;
5132 if (xmlRelaxNGParseNameClass(ctxt, child, cur) != NULL) {
5134 ret->content = cur;
5136 last->next = cur;
5138 last = cur;
5299 xmlRelaxNGDefinePtr ret, cur, last;
5315 cur = xmlRelaxNGParseNameClass(ctxt, child, ret);
5316 if (cur != NULL)
5329 cur = xmlRelaxNGParsePattern(ctxt, child);
5330 if (cur != NULL) {
5331 cur->parent = ret;
5332 switch (cur->type) {
5351 ret->content = last = cur;
5363 last->next = cur;
5364 last = cur;
5368 cur->next = ret->attrs;
5369 ret->attrs = cur;
5413 xmlRelaxNGDefinePtr def = NULL, last = NULL, cur, parent;
5418 cur = xmlRelaxNGParseElement(ctxt, nodes);
5420 def = last = cur;
5428 last->next = cur;
5429 last = cur;
5431 cur->parent = parent;
5433 cur = xmlRelaxNGParsePattern(ctxt, nodes);
5434 if (cur != NULL) {
5436 def = last = cur;
5438 last->next = cur;
5439 last = cur;
5570 xmlRelaxNGDefinePtr def, cur;
5588 cur = ref;
5589 while (cur != NULL) {
5590 cur->content = def;
5591 cur = cur->nextHash;
5621 xmlRelaxNGDefinePtr cur, last, tmp, tmp2;
5625 cur = define;
5626 while (cur != NULL) {
5627 combine = xmlGetProp(cur->node, BAD_CAST "combine");
5661 cur = cur->nextHash;
5670 cur = xmlRelaxNGNewDefine(ctxt, define->node);
5671 if (cur == NULL)
5674 cur->type = XML_RELAXNG_INTERLEAVE;
5676 cur->type = XML_RELAXNG_CHOICE;
5694 cur->content = tmp2;
5700 tmp->content = cur;
5703 define->content = cur;
5715 if (xmlHashAddEntry(ctxt->interleaves, BAD_CAST tmpname, cur) <
5741 xmlRelaxNGDefinePtr cur;
5746 cur = starts;
5747 while (cur != NULL) {
5748 if ((cur->node == NULL) || (cur->node->parent == NULL) ||
5749 (!xmlStrEqual(cur->node->parent->name, BAD_CAST "start"))) {
5751 xmlRngPErr(ctxt, cur->node, XML_RNGP_START_MISSING,
5755 combine = xmlGetProp(cur->node->parent, BAD_CAST "combine");
5763 xmlRngPErr(ctxt, cur->node, XML_RNGP_START_CHOICE_AND_INTERLEAVE,
5771 xmlRngPErr(ctxt, cur->node, XML_RNGP_START_CHOICE_AND_INTERLEAVE,
5776 xmlRngPErr(ctxt, cur->node, XML_RNGP_UNKNOWN_COMBINE,
5785 xmlRngPErr(ctxt, cur->node, XML_RNGP_NEED_COMBINE,
5791 cur = cur->next;
5800 cur = xmlRelaxNGNewDefine(ctxt, starts->node);
5801 if (cur == NULL)
5804 cur->type = XML_RELAXNG_INTERLEAVE;
5806 cur->type = XML_RELAXNG_CHOICE;
5807 cur->content = grammar->start;
5808 grammar->start = cur;
5813 xmlRngPErr(ctxt, cur->node, XML_RNGP_INTERLEAVE_CREATE_FAILED,
5820 if (xmlHashAddEntry(ctxt->interleaves, BAD_CAST tmpname, cur) <
5822 xmlRngPErr(ctxt, cur->node, XML_RNGP_INTERLEAVE_CREATE_FAILED,
5842 xmlRelaxNGDefinePtr cur, int depth)
5846 while ((ret == 0) && (cur != NULL)) {
5847 if ((cur->type == XML_RELAXNG_REF) ||
5848 (cur->type == XML_RELAXNG_PARENTREF)) {
5849 if (cur->depth == -1) {
5850 cur->depth = depth;
5851 ret = xmlRelaxNGCheckCycles(ctxt, cur->content, depth);
5852 cur->depth = -2;
5853 } else if (depth == cur->depth) {
5854 xmlRngPErr(ctxt, cur->node, XML_RNGP_REF_CYCLE,
5856 cur->name, NULL);
5859 } else if (cur->type == XML_RELAXNG_ELEMENT) {
5860 ret = xmlRelaxNGCheckCycles(ctxt, cur->content, depth + 1);
5862 ret = xmlRelaxNGCheckCycles(ctxt, cur->content, depth);
5864 cur = cur->next;
5872 * @cur: the definition to unlink
5882 xmlRelaxNGDefinePtr cur,
5886 prev->next = cur->next;
5889 if (parent->content == cur)
5890 parent->content = cur->next;
5891 else if (parent->attrs == cur)
5892 parent->attrs = cur->next;
5893 else if (parent->nameClass == cur)
5894 parent->nameClass = cur->next;
5896 cur->type = XML_RELAXNG_NOOP;
5897 prev = cur;
5912 xmlRelaxNGDefinePtr cur, xmlRelaxNGDefinePtr parent)
5916 while (cur != NULL) {
5917 if ((cur->type == XML_RELAXNG_REF) ||
5918 (cur->type == XML_RELAXNG_PARENTREF)) {
5919 if (cur->depth != -3) {
5920 cur->depth = -3;
5921 xmlRelaxNGSimplify(ctxt, cur->content, cur);
5923 } else if (cur->type == XML_RELAXNG_NOT_ALLOWED) {
5924 cur->parent = parent;
5936 prev = xmlRelaxNGTryUnlink(ctxt, cur, parent, prev);
5938 prev = cur;
5939 } else if (cur->type == XML_RELAXNG_EMPTY) {
5940 cur->parent = parent;
5950 prev = xmlRelaxNGTryUnlink(ctxt, cur, parent, prev);
5952 prev = cur;
5954 cur->parent = parent;
5955 if (cur->content != NULL)
5956 xmlRelaxNGSimplify(ctxt, cur->content, cur);
5957 if ((cur->type != XML_RELAXNG_VALUE) && (cur->attrs != NULL))
5958 xmlRelaxNGSimplify(ctxt, cur->attrs, cur);
5959 if (cur->nameClass != NULL)
5960 xmlRelaxNGSimplify(ctxt, cur->nameClass, cur);
5965 if (cur->type == XML_RELAXNG_ELEMENT) {
5969 while (cur->content != NULL) {
5971 xmlRelaxNGGenerateAttributes(ctxt, cur->content);
5974 * migrate cur->content to attrs
5976 tmp = cur->content;
5977 cur->content = tmp->next;
5978 tmp->next = cur->attrs;
5979 cur->attrs = tmp;
5982 * cur->content can generate elements or text
5987 pre = cur->content;
5996 tmp->next = cur->attrs;
5997 cur->attrs = tmp;
6006 if ((cur->type == XML_RELAXNG_GROUP) ||
6007 (cur->type == XML_RELAXNG_INTERLEAVE)) {
6008 if (cur->content == NULL)
6009 cur->type = XML_RELAXNG_EMPTY;
6010 else if (cur->content->next == NULL) {
6012 cur->type = XML_RELAXNG_NOOP;
6014 parent->content = cur->content;
6015 cur->content->next = cur->next;
6016 cur = cur->content;
6018 cur->content->next = cur->next;
6019 prev->next = cur->content;
6020 cur = cur->content;
6027 if ((cur->type == XML_RELAXNG_EXCEPT) &&
6028 (cur->content != NULL) &&
6029 (cur->content->type == XML_RELAXNG_NOT_ALLOWED)) {
6030 prev = xmlRelaxNGTryUnlink(ctxt, cur, parent, prev);
6031 } else if (cur->type == XML_RELAXNG_NOT_ALLOWED) {
6044 prev = xmlRelaxNGTryUnlink(ctxt, cur, parent, prev);
6046 prev = cur;
6047 } else if (cur->type == XML_RELAXNG_EMPTY) {
6058 prev = xmlRelaxNGTryUnlink(ctxt, cur, parent, prev);
6060 prev = cur;
6062 prev = cur;
6065 cur = cur->next;
6123 * @cur: the current definition
6129 * Returns the content type of @cur
6133 xmlRelaxNGDefinePtr cur, int flags,
6139 while (cur != NULL) {
6141 if ((cur->type == XML_RELAXNG_REF) ||
6142 (cur->type == XML_RELAXNG_PARENTREF)) {
6150 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_REF,
6156 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_REF,
6160 if (cur->depth > -4) {
6161 cur->depth = -4;
6162 ret = xmlRelaxNGCheckRules(ctxt, cur->content,
6163 flags, cur->type);
6164 cur->depth = ret - 15;
6165 } else if (cur->depth == -4) {
6168 ret = (xmlRelaxNGContentType) (cur->depth + 15);
6170 } else if (cur->type == XML_RELAXNG_ELEMENT) {
6174 xmlRelaxNGCheckGroupAttrs(ctxt, cur);
6176 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_ELEM,
6181 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_ELEM,
6186 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_ATTR_ELEM,
6191 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_ATTR_ELEM,
6201 xmlRelaxNGCheckRules(ctxt, cur->attrs, nflags, cur->type);
6203 xmlRngPErr(ctxt, cur->node, XML_RNGP_ELEM_CONTENT_EMPTY,
6205 cur->name, NULL);
6208 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6209 cur->type);
6211 xmlRngPErr(ctxt, cur->node, XML_RNGP_ELEM_CONTENT_ERROR,
6213 cur->name, NULL);
6217 } else if (cur->type == XML_RELAXNG_ATTRIBUTE) {
6219 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_ATTR_ATTR,
6224 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_ATTR,
6229 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_ONEMORE_GROUP_ATTR,
6234 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR,
6239 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_ATTR,
6244 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_ATTR,
6249 && (cur->name == NULL)) {
6250 if (cur->ns == NULL) {
6251 xmlRngPErr(ctxt, cur->node, XML_RNGP_ANYNAME_ATTR_ANCESTOR,
6255 xmlRngPErr(ctxt, cur->node, XML_RNGP_NSNAME_ATTR_ANCESTOR,
6261 xmlRelaxNGCheckRules(ctxt, cur->content, nflags, cur->type);
6263 } else if ((cur->type == XML_RELAXNG_ONEORMORE) ||
6264 (cur->type == XML_RELAXNG_ZEROORMORE)) {
6266 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_ONEMORE,
6271 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_ONEMORE,
6277 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6278 cur->type);
6280 } else if (cur->type == XML_RELAXNG_LIST) {
6282 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_LIST,
6287 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_LIST,
6292 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_LIST,
6298 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6299 cur->type);
6300 } else if (cur->type == XML_RELAXNG_GROUP) {
6302 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_GROUP,
6307 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_GROUP,
6316 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6317 cur->type);
6321 xmlRelaxNGCheckGroupAttrs(ctxt, cur);
6322 } else if (cur->type == XML_RELAXNG_INTERLEAVE) {
6324 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_INTERLEAVE,
6329 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE,
6334 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE,
6343 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6344 cur->type);
6345 } else if (cur->type == XML_RELAXNG_EXCEPT) {
6346 if ((cur->parent != NULL) &&
6347 (cur->parent->type == XML_RELAXNG_DATATYPE))
6352 xmlRelaxNGCheckRules(ctxt, cur->content, nflags,
6353 cur->type);
6354 } else if (cur->type == XML_RELAXNG_DATATYPE) {
6356 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_DATA,
6360 xmlRelaxNGCheckRules(ctxt, cur->content, flags, cur->type);
6362 } else if (cur->type == XML_RELAXNG_VALUE) {
6364 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_VALUE,
6368 xmlRelaxNGCheckRules(ctxt, cur->content, flags, cur->type);
6370 } else if (cur->type == XML_RELAXNG_TEXT) {
6372 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_TEXT,
6377 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_TEXT,
6382 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_TEXT,
6387 } else if (cur->type == XML_RELAXNG_EMPTY) {
6389 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_EMPTY,
6394 xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_START_EMPTY,
6399 } else if (cur->type == XML_RELAXNG_CHOICE) {
6400 xmlRelaxNGCheckChoiceDeterminism(ctxt, cur);
6402 xmlRelaxNGCheckRules(ctxt, cur->content, flags, cur->type);
6405 xmlRelaxNGCheckRules(ctxt, cur->content, flags, cur->type);
6407 cur = cur->next;
6734 xmlChar *cur = value;
6739 while (IS_BLANK_CH(*cur))
6740 cur++;
6741 if (cur == start) {
6743 while ((*cur != 0) && (!IS_BLANK_CH(*cur)))
6744 cur++;
6745 if (*cur == 0)
6747 start = cur;
6748 while (IS_BLANK_CH(*cur))
6749 cur++;
6750 if (*cur == 0) {
6757 while ((*cur != 0) && (!IS_BLANK_CH(*cur)))
6758 *start++ = *cur++;
6759 if (*cur == 0) {
6764 while (IS_BLANK_CH(*cur))
6765 cur++;
6766 if (*cur == 0) {
6770 *start++ = *cur++;
6785 xmlAttrPtr cur, next;
6787 cur = node->properties;
6788 while (cur != NULL) {
6789 next = cur->next;
6790 if ((cur->ns == NULL) ||
6791 (xmlStrEqual(cur->ns->href, xmlRelaxNGNs))) {
6792 if (xmlStrEqual(cur->name, BAD_CAST "name")) {
6801 cur->name, node->name);
6803 } else if (xmlStrEqual(cur->name, BAD_CAST "type")) {
6808 cur->name, node->name);
6810 } else if (xmlStrEqual(cur->name, BAD_CAST "href")) {
6815 cur->name, node->name);
6817 } else if (xmlStrEqual(cur->name, BAD_CAST "combine")) {
6822 cur->name, node->name);
6824 } else if (xmlStrEqual(cur->name, BAD_CAST "datatypeLibrary")) {
6828 val = xmlNodeListGetString(node->doc, cur->children, 1);
6835 cur->name, val);
6840 cur->name, val);
6845 cur->name, val);
6852 } else if (!xmlStrEqual(cur->name, BAD_CAST "ns")) {
6854 "Unknown attribute %s on %s\n", cur->name,
6858 cur = next;
6873 xmlNodePtr cur, delete;
6876 cur = root;
6877 while (cur != NULL) {
6883 if (cur->type == XML_ELEMENT_NODE) {
6887 if ((cur->ns == NULL) ||
6888 (!xmlStrEqual(cur->ns->href, xmlRelaxNGNs))) {
6889 if ((cur->parent != NULL) &&
6890 (cur->parent->type == XML_ELEMENT_NODE) &&
6891 ((xmlStrEqual(cur->parent->name, BAD_CAST "name")) ||
6892 (xmlStrEqual(cur->parent->name, BAD_CAST "value")) ||
6893 (xmlStrEqual(cur->parent->name, BAD_CAST "param")))) {
6894 xmlRngPErr(ctxt, cur, XML_RNGP_FOREIGN_ELEMENT,
6896 cur->parent->name, NULL);
6898 delete = cur;
6901 xmlRelaxNGCleanupAttributes(ctxt, cur);
6902 if (xmlStrEqual(cur->name, BAD_CAST "externalRef")) {
6908 ns = xmlGetProp(cur, BAD_CAST "ns");
6910 tmp = cur->parent;
6919 href = xmlGetProp(cur, BAD_CAST "href");
6921 xmlRngPErr(ctxt, cur, XML_RNGP_MISSING_HREF,
6926 delete = cur;
6931 xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
6938 delete = cur;
6942 xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
6950 delete = cur;
6954 base = xmlNodeGetBase(cur->doc, cur);
6957 xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
6966 delete = cur;
6975 xmlRngPErr(ctxt, cur, XML_RNGP_EXTERNAL_REF_FAILURE,
6981 delete = cur;
6987 cur->psvi = docu;
6988 } else if (xmlStrEqual(cur->name, BAD_CAST "include")) {
6993 href = xmlGetProp(cur, BAD_CAST "href");
6995 xmlRngPErr(ctxt, cur, XML_RNGP_MISSING_HREF,
6998 delete = cur;
7001 base = xmlNodeGetBase(cur->doc, cur);
7004 xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
7011 delete = cur;
7018 ns = xmlGetProp(cur, BAD_CAST "ns");
7020 tmp = cur->parent;
7029 incl = xmlRelaxNGLoadInclude(ctxt, URL, cur, ns);
7033 xmlRngPErr(ctxt, cur, XML_RNGP_INCLUDE_FAILURE,
7037 delete = cur;
7041 cur->psvi = incl;
7042 } else if ((xmlStrEqual(cur->name, BAD_CAST "element")) ||
7043 (xmlStrEqual(cur->name, BAD_CAST "attribute")))
7052 name = xmlGetProp(cur, BAD_CAST "name");
7054 if (cur->children == NULL) {
7056 xmlNewChild(cur, cur->ns, BAD_CAST "name",
7061 node = xmlNewDocNode(cur->doc, cur->ns,
7064 xmlAddPrevSibling(cur->children, node);
7071 xmlRngPErr(ctxt, cur, XML_RNGP_CREATE_FAILURE,
7075 xmlUnsetProp(cur, BAD_CAST "name");
7077 ns = xmlGetProp(cur, BAD_CAST "ns");
7081 /* xmlUnsetProp(cur, BAD_CAST "ns"); */
7084 } else if (xmlStrEqual(cur->name,
7089 } else if ((xmlStrEqual(cur->name, BAD_CAST "name")) ||
7090 (xmlStrEqual(cur->name, BAD_CAST "nsName")) ||
7091 (xmlStrEqual(cur->name, BAD_CAST "value"))) {
7096 if (xmlHasProp(cur, BAD_CAST "ns") == NULL) {
7100 node = cur->parent;
7110 xmlSetProp(cur, BAD_CAST "ns", BAD_CAST "");
7112 xmlSetProp(cur, BAD_CAST "ns", ns);
7116 if (xmlStrEqual(cur->name, BAD_CAST "name")) {
7122 name = xmlNodeGetContent(cur);
7128 ns = xmlSearchNs(cur->doc, cur, prefix);
7130 xmlRngPErr(ctxt, cur,
7135 xmlSetProp(cur, BAD_CAST "ns",
7137 xmlNodeSetContent(cur, local);
7148 if (xmlStrEqual(cur->name, BAD_CAST "nsName")) {
7150 xmlRngPErr(ctxt, cur,
7156 } else if ((xmlStrEqual(cur->name, BAD_CAST "except")) &&
7157 (cur != root)) {
7163 if ((cur->parent != NULL) &&
7165 (cur->parent->name, BAD_CAST "anyName"))) {
7167 xmlRelaxNGCleanupTree(ctxt, cur);
7170 } else if ((cur->parent != NULL) &&
7172 (cur->parent->name, BAD_CAST "nsName"))) {
7174 xmlRelaxNGCleanupTree(ctxt, cur);
7178 } else if (xmlStrEqual(cur->name, BAD_CAST "anyName")) {
7183 xmlRngPErr(ctxt, cur,
7188 xmlRngPErr(ctxt, cur,
7198 if (xmlStrEqual(cur->name, BAD_CAST "div")) {
7206 ns = xmlGetProp(cur, BAD_CAST "ns");
7208 child = cur->children;
7209 ins = cur;
7224 * Since we are about to delete cur, if it's nsDef is non-NULL we
7227 * of cur->parent's list, since it's never going to be re-serialized
7230 if (cur->nsDef != NULL) {
7231 xmlNsPtr parDef = (xmlNsPtr)&cur->parent->nsDef;
7234 parDef->next = cur->nsDef;
7235 cur->nsDef = NULL;
7237 delete = cur;
7245 else if ((cur->type == XML_TEXT_NODE) ||
7246 (cur->type == XML_CDATA_SECTION_NODE)) {
7247 if (IS_BLANK_NODE(cur)) {
7248 if (cur->parent->type == XML_ELEMENT_NODE) {
7249 if ((!xmlStrEqual(cur->parent->name, BAD_CAST "value"))
7252 (cur->parent->name, BAD_CAST "param")))
7253 delete = cur;
7255 delete = cur;
7260 delete = cur;
7267 if (cur->children != NULL) {
7268 if ((cur->children->type != XML_ENTITY_DECL) &&
7269 (cur->children->type != XML_ENTITY_REF_NODE) &&
7270 (cur->children->type != XML_ENTITY_NODE)) {
7271 cur = cur->children;
7276 if (cur->next != NULL) {
7277 cur = cur->next;
7282 cur = cur->parent;
7283 if (cur == NULL)
7285 if (cur == root) {
7286 cur = NULL;
7289 if (cur->next != NULL) {
7290 cur = cur->next;
7293 } while (cur != NULL);
7850 xmlNodePtr cur;
7860 cur = content;
7861 while (cur != NULL) {
7862 ctxt->state->seq = cur;
7863 switch (cur->type) {
7866 if (xmlIsBlankNode(cur))
7871 cur->parent->name);
7875 if (cur->ns != NULL) {
7876 ret = xmlRegExecPushString2(exec, cur->name,
7877 cur->ns->href, ctxt);
7879 ret = xmlRegExecPushString(exec, cur->name, ctxt);
7882 VALID_ERR2(XML_RELAXNG_ERR_ELEMWRONG, cur->name);
7893 cur = cur->next;
8461 xmlRelaxNGDefinePtr cur;
8490 cur = define->attrs;
8491 while ((ret == 0) && (cur != NULL) && (cur->type == XML_RELAXNG_PARAM)) {
8493 tmp = lib->facet(lib->data, define->name, cur->name,
8494 cur->value, value, result);
8498 cur = cur->next;
8527 xmlChar *cur;
8529 cur = ctxt->state->value;
8530 if ((cur == NULL) || (ctxt->state->endvalue == NULL)) {
8535 while (*cur != 0)
8536 cur++;
8537 while ((cur != ctxt->state->endvalue) && (*cur == 0))
8538 cur++;
8539 if (cur == ctxt->state->endvalue)
8542 ctxt->state->value = cur;
8682 xmlChar *oldvalue, *oldend, *val, *cur;
8699 cur = val;
8700 while (*cur != 0) {
8701 if (IS_BLANK_CH(*cur)) {
8702 *cur = 0;
8703 cur++;
8707 while (IS_BLANK_CH(*cur))
8708 *cur++ = 0;
8710 cur++;
8718 ctxt->state->endvalue = cur;
8719 cur = val;
8720 while ((*cur == 0) && (cur != ctxt->state->endvalue))
8721 cur++;
8723 ctxt->state->value = cur;
8761 xmlChar *cur, *temp;
8765 cur = ctxt->state->value;
8767 while ((cur != NULL) && (cur != ctxt->state->endvalue) &&
8768 (temp != cur)) {
8769 temp = cur;
8777 cur = ctxt->state->value;
9026 xmlRelaxNGDefinePtr cur;
9028 cur = defines;
9029 while (cur != NULL) {
9030 if (cur->type == XML_RELAXNG_ATTRIBUTE) {
9031 if (xmlRelaxNGValidateAttribute(ctxt, cur) != 0)
9035 cur = cur->next;
9039 cur = defines;
9040 while (cur != NULL) {
9041 if (cur->type != XML_RELAXNG_ATTRIBUTE) {
9043 res = xmlRelaxNGValidateDefinition(ctxt, cur);
9053 cur = cur->next;
9071 xmlRelaxNGDefinePtr cur;
9077 cur = list[i++];
9078 while (cur != NULL) {
9080 (cur->type == XML_RELAXNG_ELEMENT)) {
9081 tmp = xmlRelaxNGElementMatch(NULL, cur, node);
9086 (cur->type == XML_RELAXNG_TEXT)) {
9089 cur = list[i++];
9114 xmlNodePtr cur, start, last = NULL, lastchg = NULL, lastelem;
9177 cur = ctxt->state->seq;
9178 cur = xmlRelaxNGSkipIgnored(ctxt, cur);
9179 start = cur;
9180 while (cur != NULL) {
9181 ctxt->state->seq = cur;
9186 if ((cur->type == XML_TEXT_NODE) ||
9187 (cur->type == XML_CDATA_SECTION_NODE)) {
9190 } else if (cur->type == XML_ELEMENT_NODE) {
9191 if (cur->ns != NULL) {
9192 tmp = xmlHashLookup2(partitions->triage, cur->name,
9193 cur->ns->href);
9197 cur->ns->href);
9200 xmlHashLookup2(partitions->triage, cur->name,
9214 if (!xmlRelaxNGNodeMatchesList(cur, group->defs))
9223 if (xmlRelaxNGNodeMatchesList(cur, group->defs))
9234 lasts[i]->next = cur;
9235 lasts[i] = cur;
9237 list[i] = cur;
9238 lasts[i] = cur;
9240 if (cur->next != NULL)
9241 lastchg = cur->next;
9243 lastchg = cur;
9244 cur = xmlRelaxNGSkipIgnored(ctxt, cur->next);
9251 lastelem = cur;
9265 cur = ctxt->state->seq;
9266 cur = xmlRelaxNGSkipIgnored(ctxt, cur);
9270 if (cur != NULL) {
9271 VALID_ERR2(XML_RELAXNG_ERR_INTEREXTRA, cur->name);
9287 cur = ctxt->states->tabState[j]->seq;
9288 cur = xmlRelaxNGSkipIgnored(ctxt, cur);
9289 if (cur == NULL) {
9334 VALID_ERR2(XML_RELAXNG_ERR_INTEREXTRA, cur->name);
9362 cur = lastchg;
9363 while (cur != NULL) {
9364 if ((cur == start) || (cur->prev == NULL))
9366 cur->prev->next = cur;
9367 cur = cur->prev;