@@ -38,6 +38,8 @@ RELIANCE, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO LOSS OF
38
38
import java .util .Collection ;
39
39
import java .util .Locale ;
40
40
import javax .xml .parsers .DocumentBuilder ;
41
+ import javax .xml .parsers .DocumentBuilderFactory ;
42
+ import javax .xml .parsers .ParserConfigurationException ;
41
43
import javax .xml .transform .OutputKeys ;
42
44
import javax .xml .transform .Transformer ;
43
45
import javax .xml .transform .TransformerFactory ;
@@ -47,7 +49,6 @@ RELIANCE, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO LOSS OF
47
49
import org .apache .tools .ant .Project ;
48
50
import org .apache .tools .ant .Task ;
49
51
import org .dita .dost .log .DITAOTAntLogger ;
50
- import org .dita .dost .util .XMLUtils ;
51
52
import org .dita .index .configuration .IndexConfiguration ;
52
53
import org .dita .index .configuration .ParseException ;
53
54
import org .w3c .dom .Document ;
@@ -71,12 +72,13 @@ public class IndexPreprocessorTask extends Task {
71
72
public void execute () throws BuildException {
72
73
checkParameters ();
73
74
74
- final DocumentBuilder documentBuilder = XMLUtils .getDocumentBuilder ();
75
-
76
75
final Document doc ;
77
76
try {
77
+ final DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance ();
78
+ factory .setNamespaceAware (true );
79
+ final DocumentBuilder documentBuilder = factory .newDocumentBuilder ();
78
80
doc = documentBuilder .parse (input );
79
- } catch (SAXException | IOException e ) {
81
+ } catch (SAXException | IOException | ParserConfigurationException e ) {
80
82
throw new BuildException (e );
81
83
}
82
84
0 commit comments