String slopString=DOMUtils.getAttributeOrFail(e,"slop");
int slop=Integer.parseInt(slopString);
boolean inOrder=DOMUtils.getAttribute(e,"inOrder",false);
ArrayList spans=new ArrayList();
for (Node kid = e.getFirstChild(); kid != null; kid = kid.getNextSibling())
{
if (kid.getNodeType() == Node.ELEMENT_NODE)
{
spans.add(factory.getSpanQuery((Element) kid));
}
}
SpanQuery[] spanQueries=(SpanQuery[]) spans.toArray(new SpanQuery[spans.size()]);
SpanNearQuery snq=new SpanNearQuery(spanQueries,slop,inOrder);
return snq;