Package org.w3c.dom

Examples of org.w3c.dom.NodeList


            DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
            fact.setNamespaceAware(true);
            DocumentBuilder bldr = fact.newDocumentBuilder();
            doc = bldr.parse(m_wsdlProvider.getWSDL(req));
            Element schema = doc.getDocumentElement();
            NodeList services = schema.getElementsByTagNameNS(WSDLSOAP_NAMESPACE, "address");
            for (int i = 0; i < services.getLength(); i++) {
                Node node = services.item(i).getAttributes().getNamedItem("location");
                if (node != null) {
                    String location = node.getTextContent();
                    node.setTextContent(adaptLocation(location, locationBase));
                }
            }
View Full Code Here


      Document qbXML = getDocumentFromString(xml);

      String idXML = getQBXMLName(qbXML);
      String nameQBXML = idXML.substring(0, idXML.length() - 5);

      NodeList list = qbXML.getElementsByTagName(nameQBXML + "AddRs");
      Node tmp = null;

      int requestID = 0;
      int length = list.getLength();

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

        tmp = list.item(i);
        requestID = Integer.parseInt(tmp.getAttributes().getNamedItem(ATTR_REQUEST_ID).getNodeValue());

        if (!tmp.getAttributes().getNamedItem(ATTR_STATUS_CODE).getNodeValue().equals("0"))
        {
          System.out.print("******RequestID = " + requestID);
View Full Code Here

  {
    HashMap hm = new HashMap();

    try
    {
      NodeList list = getDocumentFromString(qbxml).getElementsByTagName(qbxmlName.substring(0, qbxmlName.length() - 7) + "Ret");
      Node node = null;

      String externalID;
      String editSequence;

      int length = list.getLength();

      for (int i = 0; i < length; i++)
      {
        node = list.item(i);
        externalID = getValueOfNodeByTagName(node, TAG_LISTID);
        editSequence = getValueOfNodeByTagName(node, "EditSequence");
        hm.put(externalID, editSequence);
      }
    } catch (Exception e)
View Full Code Here

      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

      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

   * @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

      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

      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

            }
        }
    }
   
    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

    }

  }
  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

TOP

Related Classes of org.w3c.dom.NodeList

Copyright © 2018 www.massapicom. 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.