Also output JSON if requested for narrative, snapshot generation & transformations
This commit is contained in:
parent
7d38ed4161
commit
ed32fca1d4
|
@ -484,6 +484,8 @@ public class Validator {
|
||||||
private static void handleOutputToStream(Resource r, String output, OutputStream s) throws IOException {
|
private static void handleOutputToStream(Resource r, String output, OutputStream s) throws IOException {
|
||||||
if (output.endsWith(".html") || output.endsWith(".htm") && r instanceof DomainResource)
|
if (output.endsWith(".html") || output.endsWith(".htm") && r instanceof DomainResource)
|
||||||
new XhtmlComposer(XhtmlComposer.HTML, true).compose(s, ((DomainResource) r).getText().getDiv());
|
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
|
else
|
||||||
new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s, r);
|
new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s, r);
|
||||||
s.close();
|
s.close();
|
||||||
|
|
Loading…
Reference in New Issue