
In some cases, the `rule.adoc` at root of a rule is never included anywhere and thus is dead code. It's a maintenance cost by itself, but also it misses opportunities to inline code that seems used by two documents when in fact only one document is actually rendered. And this missed opportunity, in turn, stops us from applying the correct language tag on the code samples.
26 lines
559 B
Plaintext
26 lines
559 B
Plaintext
== How to fix it in Dom4j
|
|
|
|
=== Code examples
|
|
|
|
include::../common/code-rationale.adoc[]
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,java,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
import org.dom4j.io.SAXReader;
|
|
|
|
SAXReader xmlReader = new SAXReader();
|
|
xmlReader.setFeature("http://apache.org/xml/features/xinclude", true); // Noncompliant
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,java,diff-id=2,diff-type=compliant]
|
|
----
|
|
import org.dom4j.io.SAXReader;
|
|
|
|
SAXReader xmlReader = new SAXReader();
|
|
xmlReader.setFeature("http://apache.org/xml/features/xinclude", false);
|
|
----
|