Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004-2010 Sunil Kamath (IcemanK). All rights reserved. This
 * program is made available under the terms of the Common Public License v1.0
 * which is available at http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors: Sunil Kamath (IcemanK) - initial API and implementation
 *******************************************************************************/

import org.w3c.dom.*;

public class Main {
    public static String readTextNode(Node item) {
        StringBuffer buf = new StringBuffer(""); //$NON-NLS-1$
        NodeList children2 = item.getChildNodes();
        if (children2 != null) {
            for (int k = 0; k < children2.getLength(); k++) {
                Node item2 = children2.item(k);
                if (item2 != null) {
                    buf.append(item2.getNodeValue());
                }
            }
        }
        return buf.toString();
    }
}