valueExpr = parseCommonContent();
if(valueExpr instanceof TextContent) {
attval.append(((TextContent) valueExpr).getValue().toString());
} else {
if(attval.length() > 0) {
valueList.add(new TextContent(attval.toString()));
attval.delete(0, attval.length());
}
valueList.add(valueExpr);
}
break;
default:
jj_la1[162] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[163] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
currentToken = jj_consume_token(CloseQuot);
break;
case OpenApos:
currentToken = jj_consume_token(OpenApos);
label_31: while(true) {
switch(jj_nt.kind) {
case LbraceExprEnclosure:
case Lbrace:
case PredefinedEntityRef:
case CharRef:
case LCurlyBraceEscape:
case RCurlyBraceEscape:
case EscapeApos:
case AposAttrContentChar:
;
break;
default:
jj_la1[164] = jj_gen;
break label_31;
}
switch(jj_nt.kind) {
case EscapeApos:
currentToken = jj_consume_token(EscapeApos);
attval.append("'");
break;
case LbraceExprEnclosure:
case Lbrace:
case PredefinedEntityRef:
case CharRef:
case LCurlyBraceEscape:
case RCurlyBraceEscape:
case AposAttrContentChar:
switch(jj_nt.kind) {
case AposAttrContentChar:
currentToken = jj_consume_token(AposAttrContentChar);
attval.append(currentToken.image);
break;
case LbraceExprEnclosure:
case Lbrace:
case PredefinedEntityRef:
case CharRef:
case LCurlyBraceEscape:
case RCurlyBraceEscape:
//CommonContent
valueExpr = parseCommonContent();
if(valueExpr instanceof TextContent) {
attval.append(((TextContent) valueExpr).getValue().toString());
} else {
if(attval.length() > 0) {
valueList.add(new TextContent(attval.toString()));
attval.delete(0, attval.length());
}
valueList.add(valueExpr);
}
break;
default:
jj_la1[165] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[166] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
currentToken = jj_consume_token(CloseApos);
break;
default:
jj_la1[167] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
// process an attribute.
String[] str = attname.split(":");
if(XMLConstants.XMLNS_ATTRIBUTE.equals(str[0])) { // namespace decl
if(valueExpr != null) { // the value of namespace decl must be an URI.
error("err:XQST0022");
}
final String prefix;
if(str.length == 1) {
prefix = "";
} else {
prefix = str[1];
}
final String val = attval.toString();
declarePrefix(prefix, val);
NamespaceConstructor nc = new NamespaceConstructor(prefix, val);
locate(nc);
atts.add(nc);
} else { // attribute
if(attval.length() > 0) {
valueList.add(new TextContent(attval.toString()));
}
if(lazyAtts == null) {
lazyAtts = new LinkedList<Pair<String, List<XQExpression>>>();
}
lazyAtts.add(new Pair<String, List<XQExpression>>(attname, valueList));