Here you can find the source of printlnCommon(Node n)
public static void printlnCommon(Node n)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 UNIT Information Technologies R&D Ltd * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/* ww w.j a v a 2 s . c o m*/ * Ferhat Erata - initial API and implementation * H. Emre Kirmizi - initial API and implementation * Serhat Celik - initial API and implementation * U. Anil Ozturk - initial API and implementation *******************************************************************************/ import org.w3c.dom.Node; public class Main { public static void printlnCommon(Node n) { System.out.print(" nodeName=\"" + n.getNodeName() + "\""); String val = n.getNamespaceURI(); if (val != null) { System.out.print(" uri=\"" + val + "\""); } val = n.getPrefix(); if (val != null) { System.out.print(" pre=\"" + val + "\""); } val = n.getLocalName(); if (val != null) { System.out.print(" local=\"" + val + "\""); } val = n.getNodeValue(); if (val != null) { System.out.print(" nodeValue="); if (val.trim().equals("")) { // Whitespace System.out.print("[WS]"); } else { System.out.print("\"" + n.getNodeValue() + "\""); } } System.out.println(); } }