Examples of NodeList


Examples of org.w3c.dom.NodeList

      Node node = qbXML.getElementsByTagName(nameQBXML).item(0);

      Document configForQBXML = getDocumentFromString(getDocumentFromString(FILE_CONFIG).getElementsByTagName(nameQBXML).item(0).toString());

      listVOAndModuleName = new HashMap();
      NodeList listQB = qbXML.getElementsByTagName(getValueOfNodeByTagName(configForQBXML, TAG_SEPARATOR) + "Ret");
      Node config = configForQBXML.getFirstChild();

      String moduleName = getValueOfNodeByTagName(config, TAG_MODULE_NAME);
      String className = getValueOfNodeByTagName(config, TAG_VONAME);

      Object cvObj = null;

      int length = listQB.getLength();
      if (node.getAttributes().getNamedItem(ATTR_STATUS_CODE).getNodeValue().equals("0"))
      {
        for (int i = 0; i < length; i++)
        {
          cvObj = getVOfromQBXML(listQB.item(i), config);
          setCVID(cvObj, moduleName, className);
          objectsCV.add(cvObj);
        }
      } else
      {
View Full Code Here

Examples of org.w3c.dom.NodeList

      String className = getValueOfNodeByTagName(configXML, TAG_VONAME);

      String typeArg = "";
      String value = "";

      NodeList listItem = configXML.getChildNodes();
      NodeList tmpNodeList = null;

      int length = listItem.getLength();

      classCV[0] = Class.forName(className);
      objectCV = classCV[0].newInstance();

      Method method = null;
      setType(objectCV, configXML, className);

      for (int i = 0; i < length; i++)
      {
        tagName = listItem.item(i).getNodeName();

        if (tagName.equals("#text") || !listItem.item(i).hasAttributes())
        {
          continue;
        }

        attr = listItem.item(i).getAttributes();

        if (attr.getNamedItem("aatocv") != null)
        {
          tmpNodeList = getDocumentFromString(xml.toString()).getElementsByTagName(tagName);

          if (tmpNodeList.getLength() != 0)
          {
            setAAtoCV(objectCV, attr, tmpNodeList, classCV, tagName);
          }
          continue;
        }

        if (attr.getNamedItem("xml") != null)
        {
          configForQBXML = getDocumentFromString(getDocumentFromString(attr.getNamedItem("xml").getNodeValue()).getElementsByTagName(attr.getNamedItem("tag").getNodeValue()).item(0).toString());
          tmpNodeList = getDocumentFromString(xml.toString()).getElementsByTagName(tagName);

          if (tmpNodeList.item(0) != null)
          {
            forward(objectCV, attr, tmpNodeList.item(0), classCV, className, configForQBXML);
          }
          continue;
        }

        value = getValueOfNodeByTagName(xml, tagName);
View Full Code Here

Examples of org.w3c.dom.NodeList

   * @param qbXML Node fragment QB XML
   * @param className String Class Name ObjectCV field
   */
  public void next(Object objectCV, Node config, Node qbXML, String className, NamedNodeMap att)
  {
    NodeList listItem = config.getChildNodes();

    Class classCV[] = new Class[1];
    Class argumentType[] = new Class[1];
    Object arguments[] = new Object[1];

    Method method = null;
    int length = listItem.getLength();

    String typeArg = "";
    String value = "";
    String tagName = "";

    Node node = att.getNamedItem("isprimary");
    try
    {
      classCV[0] = Class.forName(className);
      if (node != null)
      {
        argumentType[0] = Class.forName("java.lang.String");
        Method setPrim = classCV[0].getMethod("setIsPrimary", argumentType);
        arguments[0] = node.getNodeValue();
        setPrim.invoke(objectCV, arguments);
      }

      for (int i = 0; i < length; i++)
      {
        tagName = listItem.item(i).getNodeName();

        if (tagName.equals("#text") || !listItem.item(i).hasAttributes())
          continue;

        NamedNodeMap attr = listItem.item(i).getAttributes();
        typeArg = attr.getNamedItem("type").getNodeValue();
        argumentType[0] = getArgType(typeArg);

        value = getValueOfNodeByTagName(qbXML, tagName);

View Full Code Here

Examples of org.w3c.dom.NodeList

      String tmpXML = "";
      String className = getValueOfNodeByTagName(configXML, TAG_VONAME);
      classCV[0] = Class.forName(className);

      Node met = null;
      NodeList listItem = configXML.getChildNodes();

      int length = listItem.getLength();

      for (int i = 0; i < length; i++)
      {

        tagName = listItem.item(i).getNodeName();

        if (tagName.equals("#text") || !listItem.item(i).hasAttributes())
          continue;

        NamedNodeMap attr = listItem.item(i).getAttributes();

        if (attr.getNamedItem("cvtoaa") != null)
        {
          tmpXML = getAAfromCV(objectCV, attr, classCV, tagName);
View Full Code Here

Examples of org.w3c.dom.NodeList

      String tmpXML = "";

      Class classCV[] = new Class[1];
      classCV[0] = Class.forName(className);

      NodeList listItem = configXML.getChildNodes();

      int length = listItem.getLength();

      for (int i = 0; i < length; i++)
      {
        tagName = listItem.item(i).getNodeName();

        if (tagName.equals("#text"))
          continue;

        NamedNodeMap attr = listItem.item(i).getAttributes();

        if (attr.getNamedItem("cvtoaa") != null)
        {
          tmpXML = getAAfromCV(objectCV, attr, classCV, tagName);
View Full Code Here

Examples of org.w3c.dom.NodeList

            }
        }
    }
   
    protected void handleAction(final ExtendedNodeImpl node, final Element element, String type) {
        NodeList nodeList = element.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
          org.w3c.dom.Node xmlNode = nodeList.item(i);
          String nodeName = xmlNode.getNodeName();
          if (nodeName.equals(type)) {
            List<DroolsAction> actions = new ArrayList<DroolsAction>();
            NodeList subNodeList = xmlNode.getChildNodes();
                for (int j = 0; j < subNodeList.getLength(); j++) {
                  Element subXmlNode = (Element) subNodeList.item(j);
                  DroolsAction action = extractAction(subXmlNode);
                  actions.add(action);
                }
              node.setActions(type, actions);
            return;
View Full Code Here

Examples of org.w3c.dom.NodeList

    }

  }
  private static void normalize(Node root)
  {
    NodeList childNodes = root.getChildNodes();
    List<Node> tobeRemoved = new ArrayList<Node>();
    for(int i=0; i<childNodes.getLength(); i++)
    {
      Node node = childNodes.item(i);
      short type = node.getNodeType();
      if(Node.ELEMENT_NODE == type)
        normalize(node);
      else if(Node.TEXT_NODE == type)
      {
        if(childNodes.getLength()>1) // mixed content
          tobeRemoved.add(node);
      }

    }
View Full Code Here

Examples of org.w3c.dom.NodeList

      // give everyone an initial balance of $50
      Double initialBalance = new Double(50);
      // iterate over the accounts
      Map<String, Double> accounts = new HashMap<String, Double>();
      Element accountsElem = accountsDocument.getDocumentElement();
      NodeList accountElems = accountsElem.getElementsByTagName("account");
      for (int i = 0, n = accountElems.getLength(); i < n; i++) {
        Element accountElem = (Element) accountElems.item(i);
        // create account, assign initial balance
        String customerName = accountElem.getAttribute("holder");
        accounts.put(customerName, initialBalance);
      }
      return accounts;
View Full Code Here

Examples of org.w3c.dom.NodeList

        }
    }

    public void fillDependencies(Collection<File> files, Document doc) {
        Element rootElement = Helper.getFirstElement(doc.getElementsByTagName("dependencies"));
        NodeList nodeList = rootElement.getElementsByTagName("dependency");
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node n = nodeList.item(i);
            if (n.getNodeType() != Node.ELEMENT_NODE) {
                continue;
            }
            Element element = (Element) n;
            boolean include = true;
View Full Code Here

Examples of org.w3c.dom.NodeList

        Element rootElement = Helper.getFirstElement(doc.getElementsByTagName("properties"));
        if (rootElement == null) {
            return;
        }

        NodeList nodeList = rootElement.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node n = nodeList.item(i);
            if (n.getNodeType() != Node.ELEMENT_NODE) {
                continue;
            }
            Element element = (Element) n;
            properties.put(element.getNodeName(), element.getTextContent());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.