throws SAXException {
Event newEvent = null;
if (NS.equals(namespaceURI)) {
if (localName.equals(REPEAT)) {
String items = attrs.getValue(NODESET);
CompiledExpression expr =
compileExpr(items, locator);
StartRepeat startRepeat =
new StartRepeat(locator, namespaceURI,
localName, raw, attrs, expr);
newEvent = startRepeat;
} else if (localName.equals(ITEMSET)) {
String items = attrs.getValue(NODESET);
CompiledExpression expr =
compileExpr(items, locator);
StartItemSet startItemSet =
new StartItemSet(locator, namespaceURI,
localName, raw, attrs, expr);
newEvent = startItemSet;
} else if (isReadonlyInputControl(localName)) {
String refStr = attrs.getValue("ref");
CompiledExpression ref =
compileExpr(refStr, locator);
StartReadonlyInputControl startInputControl =
new StartReadonlyInputControl(locator,
ref,
new StartElement(locator,
namespaceURI, localName, raw, attrs));
newEvent = startInputControl;
} else if (isInputControl(localName)) {
String refStr = attrs.getValue("ref");
CompiledExpression ref =
compileExpr(refStr, locator);
StartInputControl startInputControl =
new StartInputControl(locator,
ref,
new StartElement(locator, namespaceURI,
localName, raw, attrs));
newEvent = startInputControl;
} else if (SUBMIT.equals(localName)) {
StartSubmit startSubmit =
new StartSubmit(locator,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startSubmit;
} else if (ITEM.equals(localName)) {
StartItem startItem =
new StartItem(locator,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startItem;
} else if (CHOICES.equals(localName)) {
StartChoices startChoices =
new StartChoices(locator,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startChoices;
} else if (VALUE.equals(localName)) {
StartValue startValue =
new StartValue(locator,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startValue;
} else if (OUTPUT.equals(localName)) {
String refStr = attrs.getValue(REF);
String valueStr = attrs.getValue(VALUE);
if (refStr != null && valueStr != null) {
throw new SAXParseException("ref and value are mutually exclusive", locator, null);
}
CompiledExpression ref = compileExpr(refStr,
locator);
CompiledExpression value = compileExpr(valueStr,
locator);
StartOutput startOutput =
new StartOutput(locator,
ref, value,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startOutput;
} else if (FORM.equals(localName)) {
StartForm startForm =
new StartForm(locator,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startForm;
} else if (VIOLATIONS.equals(localName)) {
StartViolations startViolations =
new StartViolations(locator,
(Event)stack.peek(),
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startViolations;
} else if (GROUP.equals(localName)) {
String refStr = attrs.getValue(REF);
CompiledExpression ref =
compileExpr(refStr, locator);
StartGroup startGroup =
new StartGroup(locator,
ref,
new StartElement(locator, namespaceURI, localName, raw, attrs));
newEvent = startGroup;
} else if (HIDDEN.equals(localName)) {
String refStr = attrs.getValue(REF);
CompiledExpression ref =
compileExpr(refStr, locator);
StartHidden startHidden =
new StartHidden(locator,
ref,
new StartElement(locator, namespaceURI, localName, raw, attrs));