if (domIterator == null) domIterator = getDOMIterator(p); else ((DOMFile.DOMFileIterator) domIterator).setTo(p); buf.reset(); getNodeValue(buf, domIterator, true); data = buf.toByteArray();
	protected NodeSet scanSequential(		NodeSet context,		DocumentSet doc,		int relation,		int truncation,		String expr) {		ArraySet resultNodeSet = new ArraySet(context.getLength());		NodeProxy p;		String content;		ByteArrayOutputStream buf = new ByteArrayOutputStream(12);		byte[] data;		long filePos;		int offset;		NodeRef nodeRef;		String cmp;		Iterator domIterator = null;		Pattern regexp = null;		if (relation == Constants.REGEXP)			try {				regexp = compiler.compile(expr.toLowerCase(), Perl5Compiler.CASE_INSENSITIVE_MASK);				truncation = Constants.REGEXP;			} catch (MalformedPatternException e) {				LOG.debug(e);			}		for (Iterator i = context.iterator(); i.hasNext();) {			p = (NodeProxy) i.next();			if (domIterator == null)				domIterator = getDOMIterator(p);			else				 ((DOMFile.DOMFileIterator) domIterator).setTo(p);			buf.reset();			getNodeValue(buf, domIterator, true);			data = buf.toByteArray();			try {				content = new String(data, 0, data.length, "UTF-8");			} catch (UnsupportedEncodingException uee) {				content = new String(data, 0, data.length);			}			if (isCaseSensitive())				cmp = content;			else {				cmp = content.toLowerCase();				expr = expr.toLowerCase();			}			//System.out.println(content);			switch (truncation) {				case Constants.TRUNC_LEFT :					if (cmp.endsWith(expr))						resultNodeSet.add(p);					break;				case Constants.TRUNC_RIGHT :					if (cmp.startsWith(expr))						resultNodeSet.add(p);					break;				case Constants.TRUNC_BOTH :					if (-1 < cmp.indexOf(expr))						resultNodeSet.add(p);					break;				case Constants.TRUNC_NONE :					if (compare(cmp, expr, relation))						resultNodeSet.add(p);					break;				case Constants.REGEXP :					if (regexp != null && matcher.contains(cmp, regexp))						resultNodeSet.add(p);			}		}		return resultNodeSet;	}