Java XML Node Value getValue(Node node, short nodeType)

Here you can find the source of getValue(Node node, short nodeType)

Description

get Value

License

Open Source License

Declaration

private static String getValue(Node node, short nodeType) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    private static String getValue(Node node, short nodeType) {
        switch (nodeType) {
        case Node.ELEMENT_NODE:
            return ((Element) node).getTagName();

        case Node.TEXT_NODE:
            return ((Text) node).getData();

        case Node.PROCESSING_INSTRUCTION_NODE:
            return ((ProcessingInstruction) node).getData();

        default://from   ww w .  j  av  a  2s  .c  om
            return "";
        }
    }
}

Related

  1. getValue(Node node)
  2. getValue(Node node)
  3. getValue(Node node)
  4. getValue(Node node, short nodeType)
  5. getValue(Node node, short nodeType)
  6. getValue(Node node, String Tag)
  7. getValue(Node pNode)
  8. getValueByElement(Node node)
  9. getValueByTagName(Node n, String tag)