Package org.dom4j

Examples of org.dom4j.Document.asXML()


        // with
        // the processed one.
        // As document has no equals method, we compare the xml representation.
        String original = document.asXML();
        Document pdoc = mod.process(document)[0];
        String modified = pdoc.asXML();
        assertEquals(
                "The returned document is different from the processed one",
                original, modified);
    }
}
View Full Code Here


            // new user are always enabled
            Element enabledE = userE.addElement("enabled");
            enabledE.addText("true");


            Element user = ClearspaceManager.getInstance().executeRequest(POST, path, groupDoc.asXML());

            return translate(user);
        } catch (UserAlreadyExistsException uaee) {
            throw uaee;
        } catch (Exception e) {
View Full Code Here

            }
            else {
                detlE.addText("No details provided.");
            }

            ClearspaceManager.getInstance().executeRequest(POST, path, auditDoc.asXML());
        }
        catch (Exception e) {
            // Error while setting properties?
            Log.error("Unable to send audit log via REST service to Clearspace:", e);
        }
View Full Code Here

            // Creates the XML with the data
            Document groupDoc = DocumentHelper.createDocument();
            Element rootE = groupDoc.addElement("updateSharedSecret");
            rootE.addElement("newSecret").setText(newSecret);

            executeRequest(POST, path, groupDoc.asXML());
        } catch (UnauthorizedException ue) {
            Log.error("Error updating the password of Clearspace", ue);
        } catch (Exception e) {
            Log.error("Error updating the password of Clearspace", e);
        }
View Full Code Here

            Element rootE = groupDoc.addElement("updateClientSettings");
            rootE.addElement("boshSslPort").setText(xmppBoshSslPort);
            rootE.addElement("boshPort").setText(xmppBoshPort);
            rootE.addElement("tcpPort").setText(xmppPort);

            executeRequest(POST, path, groupDoc.asXML());
        } catch (UnauthorizedException ue) {
            Log.error("Error updating the client settings of Clearspace", ue);
        } catch (Exception e) {
            Log.error("Error updating the client settings of Clearspace", e);
        }
View Full Code Here

            SearchRequestDsml searchRequestDsml = new SearchRequestDsml( searchRequest );
            searchRequestDsml.toDsml( rootElement );
            Dsmlv2Engine engine = new Dsmlv2Engine( browserConnection.getConnection().getHost(), browserConnection
                .getConnection().getPort(), browserConnection.getConnection().getBindPrincipal(), browserConnection
                .getConnection().getBindPassword() );
            String response = engine.processDSML( xmlRequest.asXML() );

            // Saving the response
            FileOutputStream fout = new FileOutputStream( exportDsmlFilename );
            new PrintStream( fout ).println( response );
            fout.close();
View Full Code Here

  private void configureCheckstyle(ConfigurationData config) throws CheckstyleException, DocumentException {
    Document document = DocumentHelper.parseText(config.getSubElement("module").toString());
    document.setDocType(new DefaultDocumentType("module", "-//Puppy Crawl//DTD Check Configuration 1.2//EN", "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"));
    //logger.debug("Configuring checkstyle: " + document.asXML());
    com.puppycrawl.tools.checkstyle.api.Configuration csc = ConfigurationLoader.loadConfiguration(
        new ByteArrayInputStream(document.asXML().getBytes()),
        new PropertiesExpander(new Properties()), true);
    checker = new Checker();
    // must be done before calling configure method on checker, otherwise locale setting will not be used
    checker.setLocaleCountry("en");
    checker.setLocaleLanguage("en");
View Full Code Here

          }
        }
        sb.append("</Strings>\r\n");
        return sb.toString();
      }
      return document.asXML();
    }
    else if ("get".equals(type))
    {
      if (locale != null)
      {
View Full Code Here

        {
          return "";
        }
        return e.asXML();
      }
      return document.asXML();
    }
    return document.asXML();
  }

  /**
 
View Full Code Here

        }
        return e.asXML();
      }
      return document.asXML();
    }
    return document.asXML();
  }

  /**
   * 获取资源
   *
 
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.