service.setProperty(Serializer.HIGHLIGHT_MATCHES, highlighting);
service.setProperty(EXistOutputKeys.HIGHLIGHT_MATCHES, highlighting);
	protected void startSelectNode(Attributes attribs) throws SAXException {		if (collection == null) {			reportError(FATAL_ERROR, "no collection selected");			return;		}		XMLResource resource = null;		if (!commandStack.isEmpty()) {			ForEach last = (ForEach) commandStack.peek();			resource = last.currentResource;		}		xpath = attribs.getValue("query");		if (xpath == null) {			reportError(FATAL_ERROR, "attribute 'query' is missing");			return;		}		String pHighlightElementMatches = attribs.getValue("match-tagging-elements");		boolean highlightElementMatches = true;		if (pHighlightElementMatches != null)			highlightElementMatches = pHighlightElementMatches.equals("true");		String pHighlightAttributeMatches = attribs.getValue("match-tagging-attributes");		boolean highlightAttributeMatches = false;		if (pHighlightAttributeMatches != null)			highlightAttributeMatches = pHighlightAttributeMatches.equals("true");		final long start = System.currentTimeMillis();		try {			XPathQueryServiceImpl service =				(XPathQueryServiceImpl) collection.getService("XPathQueryService", "1.0");			service.setProperty(Serializer.GENERATE_DOC_EVENTS, "false");			String highlighting = "none";			if (highlightElementMatches && highlightAttributeMatches)				highlighting = "both";			else if (highlightElementMatches)				highlighting = "elements";			else if (highlightAttributeMatches)				highlighting = "attributes";			service.setProperty(Serializer.HIGHLIGHT_MATCHES, highlighting);			setQueryContext(service);			ResourceSet queryResult =				(resource == null) ? service.query(xpath) : service.query(resource, xpath);			if (queryResult == null) {				reportError(WARNING, "query returned null");				return;			}			long len = queryResult.getSize();			for (long i = 0; i < len; i++) {				XMLResource res = (XMLResource) queryResult.getResource(i);				res.getContentAsSAX(this);			}		} catch (XMLDBException e) {			reportError(WARNING, "error during query-execution", e);		}	}