Merge pull request #40 from vadi2/output-json-snapshot
Also output JSON if requested for narrative, snapshot generation & transforms
This commit is contained in:
commit
cb843d8235
|
@ -484,6 +484,8 @@ public class Validator {
|
|||
private static void handleOutputToStream(Resource r, String output, OutputStream s) throws IOException {
|
||||
if (output.endsWith(".html") || output.endsWith(".htm") && r instanceof DomainResource)
|
||||
new XhtmlComposer(XhtmlComposer.HTML, true).compose(s, ((DomainResource) r).getText().getDiv());
|
||||
else if (output.endsWith(".json"))
|
||||
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(s, r);
|
||||
else
|
||||
new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s, r);
|
||||
s.close();
|
||||
|
|
Loading…
Reference in New Issue