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,
rootContext,
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 XPathExpr ref = startGroup.ref;
if (ref != null) {
Object value;
try {
value = ref.getNode(rootContext, currentContext);
} catch (Exception exc) {
throw new SAXParseException(exc.getMessage(),
ev.location,
exc);
}
JXPathContext localJXPathContext =
jxpathContextFactory.newContext(null, value);
String path;
if (ref.absolute) {
path = ref.string;
} else {
path = contextPath;
if (path != null) {
path += "/.";
} else {
path = "";
}
path += ref.string;
}
execute(consumer,
form,
currentView,
path,
rootContext,
localJXPathContext,
startGroup.next,
startGroup.endGroup);
ev = startGroup.endGroup;
continue;
}
} else if (ev instanceof StartItemSet) {
StartItemSet startItemSet = (StartItemSet)ev;
final XPathExpr nodeset = startItemSet.nodeset;
Iterator iter = null;
try {
if (nodeset == null) {
iter = EMPTY_ITER;
} else {
iter =
nodeset.iteratePointers(rootContext,
currentContext);
}
} 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(null, 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,
path,
rootContext,