# HG changeset patch # User Ingo Weinzierl # Date 1321876768 0 # Node ID b3eb029e07dddb2d8cd480f54bf47a42f9aa2a62 # Parent f2277458823e33fa8e0ff2e4b6e9d2b8f1cab3e8 Added a method that allows to specify if a document needs to be namespace aware while parsing from InputStream. artifacts/trunk@3294 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r f2277458823e -r b3eb029e07dd ChangeLog --- a/ChangeLog Mon Nov 07 16:40:01 2011 +0000 +++ b/ChangeLog Mon Nov 21 11:59:28 2011 +0000 @@ -1,3 +1,9 @@ +2011-11-21 Ingo Weinzierl + + * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java: + Added a method that allows to specify if the document needs to be + namespace aware or not while parsing from InputStream. + 2011-11-07 Ingo Weinzierl * artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java, diff -r f2277458823e -r b3eb029e07dd artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java --- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java Mon Nov 07 16:40:01 2011 +0000 +++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java Mon Nov 21 11:59:28 2011 +0000 @@ -209,9 +209,17 @@ return null; } + public static final Document parseDocument(InputStream inputStream) { + return parseDocument(inputStream, true); + } + + public static final Document parseDocument(InputStream inputStream, Boolean namespaceAware) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); + + if (namespaceAware != null) { + factory.setNamespaceAware(namespaceAware); + } try { return factory.newDocumentBuilder().parse(inputStream);