| 7872 | */ |
| 7873 | |
| 7874 | static int |
| 7875 | xmlSchemaPValAttrBlockFinal(const xmlChar *value, |
| 7876 | int *flags, |
| 7877 | int flagAll, |
| 7878 | int flagExtension, |
| 7879 | int flagRestriction, |
| 7880 | int flagSubstitution, |
| 7881 | int flagList, |
| 7882 | int flagUnion) |
| 7883 | { |
| 7884 | int ret = 0; |
| 7885 | |
| 7886 | /* |
| 7887 | * TODO: This does not check for duplicate entries. |
| 7888 | */ |
| 7889 | if ((flags == NULL) || (value == NULL)) |
| 7890 | return (-1); |
| 7891 | if (value[0] == 0) |
| 7892 | return (0); |
| 7893 | if (xmlStrEqual(value, BAD_CAST "#all")) { |
| 7894 | if (flagAll != -1) |
| 7895 | *flags |= flagAll; |
| 7896 | else { |
| 7897 | if (flagExtension != -1) |
| 7898 | *flags |= flagExtension; |
| 7899 | if (flagRestriction != -1) |
| 7900 | *flags |= flagRestriction; |
| 7901 | if (flagSubstitution != -1) |
| 7902 | *flags |= flagSubstitution; |
| 7903 | if (flagList != -1) |
| 7904 | *flags |= flagList; |
| 7905 | if (flagUnion != -1) |
| 7906 | *flags |= flagUnion; |
| 7907 | } |
| 7908 | } else { |
| 7909 | const xmlChar *end, *cur = value; |
| 7910 | xmlChar *item; |
| 7911 | |
| 7912 | do { |
| 7913 | while (IS_BLANK_CH(*cur)) |
| 7914 | cur++; |
| 7915 | end = cur; |
| 7916 | while ((*end != 0) && (!(IS_BLANK_CH(*end)))) |
| 7917 | end++; |
| 7918 | if (end == cur) |
| 7919 | break; |
| 7920 | item = xmlStrndup(cur, end - cur); |
| 7921 | if (xmlStrEqual(item, BAD_CAST "extension")) { |
| 7922 | if (flagExtension != -1) { |
| 7923 | if ((*flags & flagExtension) == 0) |
| 7924 | *flags |= flagExtension; |
| 7925 | } else |
| 7926 | ret = 1; |
| 7927 | } else if (xmlStrEqual(item, BAD_CAST "restriction")) { |
| 7928 | if (flagRestriction != -1) { |
| 7929 | if ((*flags & flagRestriction) == 0) |
| 7930 | *flags |= flagRestriction; |
| 7931 | } else |
no test coverage detected