示例#1
0
 private void addXmlElement(com.dragonflow.XmlApi.XmlApiObject xmlapiobject) {
   startXmlElement(xmlapiobject.getName(), xmlapiobject.getProperties(false));
   com.dragonflow.XmlApi.XmlApiObject xmlapiobject1;
   for (java.util.Enumeration enumeration = xmlapiobject.elements();
       enumeration.hasMoreElements();
       endXmlElement(xmlapiobject1)) {
     xmlapiobject1 = (com.dragonflow.XmlApi.XmlApiObject) enumeration.nextElement();
     addXmlElement(xmlapiobject1);
   }
 }
示例#2
0
  private void processNode(org.w3c.dom.Node node, com.dragonflow.XmlApi.XmlApiObject xmlapiobject) {
    if (node.getNodeType() == 1) {
      String s = node.getNodeName();
      if (s != null && s.length() > 0) {
        jgl.HashMap hashmap = new HashMap();
        org.w3c.dom.NamedNodeMap namednodemap = node.getAttributes();
        for (int i = 0; i < namednodemap.getLength(); i++) {
          org.w3c.dom.Attr attr = (org.w3c.dom.Attr) namednodemap.item(i);
          if (attr.getName() != null
              && attr.getName().equals("encodeValues")
              && attr.getValue() != null
              && (attr.getValue().equals("false") || attr.getValue().equals("true"))) {
            encodeValues = (new Boolean(attr.getValue())).booleanValue();
            continue;
          }
          String s1 = attr.getValue();
          if (s1 != null) {
            s1 = com.dragonflow.Utils.TextUtils.enlighten(s1);
          }
          hashmap.put(attr.getName(), s1);
        }

        org.w3c.dom.NodeList nodelist = node.getChildNodes();
        java.util.Vector vector = findPropNodes(nodelist);
        for (int j = 0; j < vector.size(); j++) {
          org.w3c.dom.Node node1 = (org.w3c.dom.Node) vector.elementAt(j);
          org.w3c.dom.NodeList nodelist1 = node1.getChildNodes();
          String s2 = findPropertyName(nodelist1);
          String as[] = findValueNodes(nodelist1);
          if (as.length > 1) {
            hashmap.put(s2, as);
            continue;
          }
          if (as.length == 1) {
            hashmap.put(s2, as[0]);
          } else {
            hashmap.put(s2, "");
          }
        }

        xmlapiobject.setProperties(hashmap);
        xmlapiobject.setName(s);
        java.util.Vector vector1 = findChildrenNodes(nodelist);
        for (int k = 0; k < vector1.size(); k++) {
          org.w3c.dom.Node node2 = (org.w3c.dom.Node) vector1.elementAt(k);
          processNode(node2, xmlapiobject.add());
        }
      }
    }
  }
示例#3
0
 private void endXmlElement(com.dragonflow.XmlApi.XmlApiObject xmlapiobject) {
   xmlResponse.append("</" + xmlapiobject.getName() + ">\r\n");
 }