Here you can find the source of printDocument(Document document)
Parameter | Description |
---|---|
document | the document, which should be printed |
public static void printDocument(Document document)
//package com.java2s; /**//www . jav a 2s. c om * * BPMN Validation Project to validate special BPMN Constraints, see \README.md * * Copyright (C) 2014 Philipp Neugebauer * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; public class Main { private static Transformer transformer; /** * prints the given document to system.out * * @param document * the document, which should be printed */ public static void printDocument(Document document) { try { transformer.transform(new DOMSource(document), new StreamResult(System.out)); } catch (TransformerException e) { System.err.println("printDocument failed cause of " + e); } } }