slurper.setFeature(feature.getKey(), feature.getValue());
slurper.setFeature(feature.getKey(), feature.getValue());
/** * Standard parser for xml responses. * * @param fromServer Backend indenpendent representation of data returned from http server * @return Body of response */ public static GPathResult xml(final ChainedHttpConfig config, final FromServer fromServer) { try { final XmlSlurper xml = new XmlSlurper(); xml.setEntityResolver(catalogResolver); xml.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false); xml.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); return xml.parse(new InputStreamReader(fromServer.getInputStream(), fromServer.getCharset())); } catch (IOException | SAXException | ParserConfigurationException ex) { throw new RuntimeException(ex); } }
/** * Standard parser for xml responses. * * @param fromServer Backend indenpendent representation of data returned from http server * @return Body of response */ public static GPathResult xml(final ChainedHttpConfig config, final FromServer fromServer) { try { final XmlSlurper xml = new XmlSlurper(); xml.setEntityResolver(catalogResolver); xml.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false); xml.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); return xml.parse(new InputStreamReader(fromServer.getInputStream(), fromServer.getCharset())); } catch (IOException | SAXException | ParserConfigurationException ex) { throw new TransportingException(ex); } }
/** * Standard parser for xml responses. * * @param fromServer Backend indenpendent representation of data returned from http server * @return Body of response */ public static GPathResult xml(final ChainedHttpConfig config, final FromServer fromServer) { try { final XmlSlurper xml = new XmlSlurper(); xml.setEntityResolver(catalogResolver); xml.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false); xml.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); return xml.parse(new InputStreamReader(fromServer.getInputStream(), fromServer.getCharset())); } catch (IOException | SAXException | ParserConfigurationException ex) { throw new TransportingException(ex); } }
slurper.setFeature(feature.getKey(), feature.getValue());
slurper.setFeature(feature.getKey(), feature.getValue());