| 992 | */ |
| 993 | |
| 994 | static void |
| 995 | xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { |
| 996 | xmlChar *token = NULL; |
| 997 | xmlChar *name = NULL; |
| 998 | xmlChar *URL = NULL; |
| 999 | int hasBlanks = 0; |
| 1000 | |
| 1001 | SKIP_BLANKS; |
| 1002 | if (CUR == '.') { |
| 1003 | /* |
| 1004 | * Context node. |
| 1005 | */ |
| 1006 | NEXT; |
| 1007 | PUSH(XML_OP_ELEM, NULL, NULL); |
| 1008 | return; |
| 1009 | } |
| 1010 | if (CUR == '@') { |
| 1011 | /* |
| 1012 | * Attribute test. |
| 1013 | */ |
| 1014 | if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { |
| 1015 | ERROR5(NULL, NULL, NULL, |
| 1016 | "Unexpected attribute axis in '%s'.\n", ctxt->base); |
| 1017 | ctxt->error = 1; |
| 1018 | return; |
| 1019 | } |
| 1020 | NEXT; |
| 1021 | xmlCompileAttributeTest(ctxt); |
| 1022 | if (ctxt->error != 0) |
| 1023 | goto error; |
| 1024 | return; |
| 1025 | } |
| 1026 | name = xmlPatScanNCName(ctxt); |
| 1027 | if (ctxt->error < 0) |
| 1028 | return; |
| 1029 | if (name == NULL) { |
| 1030 | if (CUR == '*') { |
| 1031 | NEXT; |
| 1032 | PUSH(XML_OP_ALL, NULL, NULL); |
| 1033 | return; |
| 1034 | } else { |
| 1035 | ERROR(NULL, NULL, NULL, |
| 1036 | "xmlCompileStepPattern : Name expected\n"); |
| 1037 | ctxt->error = 1; |
| 1038 | return; |
| 1039 | } |
| 1040 | } |
| 1041 | if (IS_BLANK_CH(CUR)) { |
| 1042 | hasBlanks = 1; |
| 1043 | SKIP_BLANKS; |
| 1044 | } |
| 1045 | if (CUR == ':') { |
| 1046 | NEXT; |
| 1047 | if (CUR != ':') { |
| 1048 | xmlChar *prefix = name; |
| 1049 | int i; |
| 1050 | |
| 1051 | if (hasBlanks || IS_BLANK_CH(CUR)) { |
no test coverage detected