1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
55 public static Document createDom() { |
55 public static Document createDom() { |
56 synchronized (DOMUtil.class) { |
56 synchronized (DOMUtil.class) { |
57 if (db == null) { |
57 if (db == null) { |
58 try { |
58 try { |
59 DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(); |
59 DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(); |
60 dbf.setNamespaceAware(true); |
|
61 db = dbf.newDocumentBuilder(); |
60 db = dbf.newDocumentBuilder(); |
62 } catch (ParserConfigurationException e) { |
61 } catch (ParserConfigurationException e) { |
63 throw new FactoryConfigurationError(e); |
62 throw new FactoryConfigurationError(e); |
64 } |
63 } |
65 } |
64 } |