Permalink
Browse files

No need to catch/print these exceptions (I think we can assume standa…

…rd JAXP SAX)
  • Loading branch information...
1 parent af894a0 commit d0f0a34cf0d2383f77da32fbc348ea1f6265d342 @djspiewak committed Feb 17, 2011
Showing with 6 additions and 9 deletions.
  1. +6 −9 src/main/scala/com/codecommit/antixml/XML.scala
@@ -24,15 +24,12 @@ object XML {
val factory = SAXParserFactory.newInstance
factory.setValidating(validate)
factory.setNamespaceAware(namespaces)
- if (!validate)
- try {
- factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
- factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false)
- factory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false)
- } catch {
- case sex: SAXNotRecognizedException => Unit
- case ex: Exception => ex.printStackTrace
- }
+
+ if (!validate) {
+ factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
+ factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false)
+ factory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false)
+ }
val parser = factory.newSAXParser
val handler = new NodeSeqSAXHandler

0 comments on commit d0f0a34

Please sign in to comment.