Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java @ 389:416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
gnv/trunk@511 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 06 Jan 2010 09:13:45 +0000 |
parents | fccf90761825 |
children | cbd397712ecf |
comparison
equal
deleted
inserted
replaced
388:6e16dc005704 | 389:416ff31f6273 |
---|---|
115 | 115 |
116 return null; | 116 return null; |
117 } | 117 } |
118 | 118 |
119 public Object getXPath(Object root, String query, QName returnType) { | 119 public Object getXPath(Object root, String query, QName returnType) { |
120 return xpath(root, query, returnType); | 120 return getXPath(root,query,returnType,ArtifactNamespaceContext.INSTANCE); |
121 } | |
122 | |
123 public Object getXPath( | |
124 Object root, String query, QName returnType, NamespaceContext context | |
125 ) { | |
126 return xpath(root, query, returnType, context); | |
121 } | 127 } |
122 | 128 |
123 public String getStringXPath(String xpath) { | 129 public String getStringXPath(String xpath) { |
124 return getStringXPath(xpath, null); | 130 return getStringXPath(xpath, null); |
125 } | 131 } |
144 public Document readDocument(InputStream inputStream) { | 150 public Document readDocument(InputStream inputStream) { |
145 Document returnValue = null; | 151 Document returnValue = null; |
146 try { | 152 try { |
147 DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory | 153 DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory |
148 .newInstance(); | 154 .newInstance(); |
155 docBuilderFactory.setNamespaceAware(true); | |
149 DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); | 156 DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); |
150 returnValue = docBuilder.parse(inputStream); | 157 returnValue = docBuilder.parse(inputStream); |
151 } catch (ParserConfigurationException e) { | 158 } catch (ParserConfigurationException e) { |
152 logger.error(e, e); | 159 logger.error(e, e); |
153 } catch (SAXException e) { | 160 } catch (SAXException e) { |