You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/08/20 18:57:30 UTC
[GitHub] [incubator-daffodil] olabusayoT commented on a change in pull request #408: WIP: Implement SAX Parsing
olabusayoT commented on a change in pull request #408:
URL: https://github.com/apache/incubator-daffodil/pull/408#discussion_r474203498
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -730,6 +722,14 @@ object Main extends Logging {
case "json" => new JsonInfosetOutputter(os, true)
case "jdom" => new JDOMInfosetOutputter()
case "w3cdom" => new W3CDOMInfosetOutputter()
+ case "sax" => {
+ // we don't actually use this infoset outputter object we create below
+ // for anything other than associating the "sax" option with the
+ // SAXInfosetOutputter. The actually SAXInfosetOutputter is contained
+ // within the DaffodilXMLReader object (see newXMLReaderInstance) of
+ // Dataprocessor
+ new SAXInfosetOutputter(new SAXHandler())
+ }
Review comment:
So it looks like I missed something on rebase, we actually do use this in the outputter match when we're outputting the result of the parse.
case _: SAXInfosetOutputter => {
new org.jdom2.output.XMLOutputter().output(saxContentHandler.getDocument, output)
}
So I updated the above to specify a null content handler, so any attempts to use it will reult in a nullpointerexception but we can still use it for a match. Would that be sufficient?
// we don't actually use this infoset outputter object we create below
// for anything other than associating the "sax" option with the
// SAXInfosetOutputter. So the contenthandler is set to null, and any
// attempts to use this will result in a NullPointerException.
//
// The actual SAXInfosetOutputter is contained
// within the DaffodilXMLReader object (see newXMLReaderInstance) of
// Dataprocessor
new SAXInfosetOutputter(null)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org