Package org.dom4j

Examples of org.dom4j.Document.asXML()


        // Add node: branch or leaf
        parent_element.addElement(childtype)
                      .addAttribute("relURI", creator.generateTreeId(childid, childType))
                      .addAttribute("doctype", doctype).addAttribute("menuName",
            creator.getChildName(childname));
        getLogger().debug("Tree has been modified: " + doc.asXML());

        // Write new tree
        java.io.FileWriter fileWriter = new java.io.FileWriter(treefilename);
        doc.write(fileWriter);
        fileWriter.close();
View Full Code Here


            }

        } catch (Exception e) {
            log.warn("w3c DOM="+this.nodeToString(w3c));
            throw new RuntimeException("Failed to process the specified template document:  "
                                    + (doc != null ? doc.asXML() : ""), e);
        }

    }

    /*
 
View Full Code Here

                if (bucket != null) {
                    log.debug("Importing the specified PortalDataKey tenant '{}':  {}",
                            tenant.getName(), pdk.getName());
                    for (Document d : bucket) {
                        doc = d;
                        log.trace("Importing document XML={}", doc.asXML());
                        for (String xpath : XPATH_EXPRESSIONS) {
                            @SuppressWarnings("unchecked")
                            List<Node> nodes = doc.selectNodes(xpath);
                            for (Node n : nodes) {
                                String inpt, otpt;
View Full Code Here

    if (blog == null) {
      throw new InputException(getLocalizedMessage("BloggingWeb", "blog.BlogNotFound", idParam, codeParam));
    }
    try {
      Document rssDoc = createArticleRssFeed(blog, req, 20);
      byte[] bytes = rssDoc.asXML().getBytes();
      resp.setCharacterEncoding(rssDoc.getXMLEncoding());
      resp.setContentType("application/rss+xml");
      resp.setContentLength(bytes.length);
      resp.getOutputStream().write(bytes);
      resp.getOutputStream().flush();
View Full Code Here

    if (blog == null) {
      throw new InputException(getLocalizedMessage("BloggingWeb", "blog.BlogNotFound", idParam, codeParam));
    }
    try {
      Document rssDoc = createCommentRssFeed(blog, req, 20);
      byte[] bytes = rssDoc.asXML().getBytes();
      resp.setCharacterEncoding(rssDoc.getXMLEncoding());
      resp.setContentType("application/rss+xml");
      resp.setContentLength(bytes.length);
      resp.getOutputStream().write(bytes);
      resp.getOutputStream().flush();
View Full Code Here

      while(it.hasNext()){
        Dto.Entry entry = (Dto.Entry)it.next();
        elRow.addAttribute((String)entry.getKey(), String.valueOf(entry.getValue()));
      }
    }
    String outXml = document.asXML().replaceAll("\n", "");
    return outXml.replace('"', '\'');
    }
   
    /**
     * 将简单图数据对象压入request
 
View Full Code Here

          Dto.Entry entry = (Dto.Entry)setIterator.next();
          elSet.addAttribute((String)entry.getKey(), String.valueOf(entry.getValue()));
        }
      }
    }
    String outXml = document.asXML().replaceAll("\n", "");
    return outXml.replace('"', '\'');
    }
}
View Full Code Here

      String value = pDto.getAsString(key);
      Element leaf = root.addElement(key);
      leaf.setText(value);
    }
    // 将XML的头声明信息截去
    String outXml = document.asXML().substring(39);
    return outXml;
  }

  /**
   * 将Dto转换为符合XML标准规范格式的字符串(基于属性值形式)
 
View Full Code Here

      String key = (String) keyIterator.next();
      String value = pDto.getAsString(key);
      firstEl.addAttribute(key, value);
    }
    // 将XML的头声明信息丢去
    String outXml = document.asXML().substring(39);
    return outXml;
  }

  /**
   * 将List数据类型转换为符合XML格式规范的字符串(基于节点属性值的方式)
 
View Full Code Here

      while (it.hasNext()) {
        Dto.Entry entry = (Dto.Entry) it.next();
        elRow.addAttribute((String) entry.getKey(), String.valueOf(entry.getValue()));
      }
    }
    String outXml = document.asXML().substring(39);
    return outXml;
  }

  /**
   * 将List数据类型转换为符合XML格式规范的字符串(基于节点值的方式)
 
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.