{
System.err.println("Error, cannot find an IngestionCrosswalk plugin for: \""+argv[i]+"\"");
System.exit(1);
}
XSLTransformer xform = ((XSLTIngestionCrosswalk)xwalk).getTransformer(DIRECTION);
if (xform == null)
throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");
SAXBuilder builder = new SAXBuilder();
Document inDoc = builder.build(new FileInputStream(argv[i+1]));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
Document dimDoc = null;
List dimList = null;
if (list)
{
dimList = xform.transform(inDoc.getRootElement().getChildren());
outputter.output(dimList, System.out);
}
else
{
dimDoc = xform.transform(inDoc);
outputter.output(dimDoc, System.out);
dimList = dimDoc.getRootElement().getChildren();
}
// Sanity-check the generated DIM, make sure it would load.