Skip to content

Filtering Rework: Mark Elements As Excluded

drmacro edited this page Oct 11, 2014 · 1 revision

(Capturing my analysis of the current filtering code so I don't forget it)

Looking at the ProfilingFilter, used from the DitaWriter as configured by the DebugAndFilter module, it looks like the relevant code is at about line 81:

		if (exclude) {
			// If it is the start of a child of an excluded tag, level increase
			level++;
		} else { // exclude shows whether it's excluded by filtering
			if (foreignLevel <= 1 && filterUtils.needExclude(atts, props)) {
				exclude = true;
				level = 0;
			} else {
			    elementOutput = true;
				getContentHandler().startElement(uri, localName, qName, atts);
			}
		}
~~~

The change would be simply add a "dita-ot:exclude='yes'" attribute to each element when exclude == true, but then apply the normal startElement() processing.

Clone this wiki locally