Java XML NodeList getTableIDOfTableAlias(String tableAlias, NodeList referList1, NodeList referList2)

Here you can find the source of getTableIDOfTableAlias(String tableAlias, NodeList referList1, NodeList referList2)

Description

get Table ID Of Table Alias

License

Open Source License

Declaration

static String getTableIDOfTableAlias(String tableAlias,
            NodeList referList1, NodeList referList2) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    static String getTableIDOfTableAlias(String tableAlias,
            NodeList referList1, NodeList referList2) {
        String tableID = tableAlias;
        org.w3c.dom.Element workElement;
        for (int j = 0; j < referList1.getLength(); j++) {
            workElement = (org.w3c.dom.Element) referList1.item(j);
            if (workElement.getAttribute("TableAlias").equals(tableAlias)
                    || (workElement.getAttribute("ToTable").equals(
                            tableAlias) && workElement.getAttribute(
                            "TableAlias").equals(""))) {
                tableID = workElement.getAttribute("ToTable");
                break;
            }/*from  w w w  .  j a v  a2s . co m*/
        }
        if (referList2 != null) {
            for (int j = 0; j < referList2.getLength(); j++) {
                workElement = (org.w3c.dom.Element) referList2.item(j);
                if (workElement.getAttribute("TableAlias").equals(
                        tableAlias)
                        || (workElement.getAttribute("ToTable").equals(
                                tableAlias) && workElement.getAttribute(
                                "TableAlias").equals(""))) {
                    tableID = workElement.getAttribute("ToTable");
                    break;
                }
            }
        }
        return tableID;
    }
}

Related

  1. getNodeTrimValue(NodeList nodeList)
  2. getNodeValue(NodeList nodes)
  3. getNodeValue(NodeList nodes, String tagName)
  4. getNodeValue(String tagName, NodeList nodes)
  5. getOccurs(String nodeName, NodeList nodes)
  6. getText(NodeList elem)
  7. getTextContent(NodeList nodeList)
  8. getTextFields(NodeList list)
  9. getXmlNodeValue(NodeList nodeList)