ev.location,
null);
}
while (iter.hasNext()) {
Object value;
Pointer ptr = (Pointer)iter.next();
try {
value = ptr.getNode();
} catch (Exception exc) {
throw new SAXParseException(exc.getMessage(),
ev.location,
exc);
}
JXPathContext localJXPathContext =
jxpathContextFactory.newContext(null, value);
String path = "";
if (contextPath != null) {
path = contextPath + "/.";
}
path += ptr.asPath();
execute(consumer,
form,
currentView,
path,
localJXPathContext,
startRepeat.next,
startRepeat.endRepeat);
}
ev = startRepeat.endRepeat.next;
continue;
} else if (ev instanceof StartGroup) {
StartGroup startGroup = (StartGroup)ev;
StartElement startElement = startGroup.startElement;
consumer.startElement(startElement.namespaceURI,
startElement.localName,
startElement.raw,
startElement.attributes);
final CompiledExpression ref = startGroup.ref;
if (ref != null) {
Object value;
try {
value = ref.getValue(jxpathContext);
} catch (Exception exc) {
throw new SAXParseException(exc.getMessage(),
ev.location,
exc);
}
JXPathContext localJXPathContext =
jxpathContextFactory.newContext(null, value);
String path = "";
if (contextPath != null) {
path = contextPath + "/.";
}
path += startElement.attributes.getValue(REF);
execute(consumer,
form,
currentView,
path,
localJXPathContext,
startGroup.next,
startGroup.endGroup);
ev = startGroup.endGroup;
continue;
}
} else if (ev instanceof StartItemSet) {
StartItemSet startItemSet = (StartItemSet)ev;
final CompiledExpression nodeset = startItemSet.nodeset;
Iterator iter = null;
try {
if (nodeset == null) {
iter = NULL_ITER;
} else {
iter =
nodeset.iteratePointers(jxpathContext);
}
} catch (Exception exc) {
throw new SAXParseException(exc.getMessage(),
ev.location,
exc);
} catch (Error err) {
throw new SAXParseException(err.getMessage(),
ev.location,
null);
}
while (iter.hasNext()) {
Object value;
Pointer ptr = (Pointer)iter.next();
try {
value = ptr.getNode();
} catch (Exception exc) {
throw new SAXParseException(exc.getMessage(),
ev.location,
exc);
}
JXPathContext localJXPathContext =
jxpathContextFactory.newContext(null, value);
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute(NS, "ref", "ref", "CDATA",
ptr.asPath());
consumer.startElement(NS, "item", "item",
attrs);
String path = "";
if (contextPath != null) {
path = contextPath + "/.";
}
path += ptr.asPath();
execute(consumer,
form,
currentView,
ptr.asPath(),
localJXPathContext,
startItemSet.next,
startItemSet.endItemSet);
consumer.endElement(NS, "item", "item");
}
ev = startItemSet.endItemSet.next;
continue;
} else if (ev instanceof StartInputControl) {
//
// input, textarea, secret, select1, selectMany
//
StartInputControl startInputControl =
(StartInputControl)ev;
CompiledExpression ref = startInputControl.ref;
StartElement startElement = startInputControl.startElement;
String refStr = startElement.attributes.getValue("ref");
consumer.startElement(startElement.namespaceURI,
startElement.localName,
startElement.raw,
startElement.attributes);
if (ref != null) {
Iterator iter = ref.iteratePointers(jxpathContext);
while (iter.hasNext()) {
Pointer ptr = (Pointer)iter.next();
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute(NS, REF, REF, "CDATA",
ptr.asPath());
consumer.startElement(NS, VALUE, VALUE, EMPTY_ATTRS);
Object val = ptr.getNode();
String str = String.valueOf(val);
consumer.characters(str.toCharArray(), 0, str.length());
consumer.endElement(NS, VALUE, VALUE);
}