Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 17th, 2011  |  syntax: None  |  size: 0.57 KB  |  views: 108  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.       final WebAppDescriptor web = Descriptors.importAs(WebAppDescriptor.class).from(
  2.             source);
  3.      
  4.       final InputStream stream = new ByteArrayInputStream(web.exportAsString().getBytes());
  5.      
  6.       final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  7.       factory.setNamespaceAware(true);
  8.       final DocumentBuilder builder = factory.newDocumentBuilder();
  9.       final Document doc=builder.parse(stream);
  10.      
  11.       final Node root = new Node(doc.getDocumentElement().getNodeName());
  12.       log.info(root.attribute("version")); // null
clone this paste RAW Paste Data