Package org.dom4j

Examples of org.dom4j.Document.asXML()


        document = reader.read(is);
      } catch (Exception e) {
        logger.error("Error while parsing xml template " + xmlString, e);
        return;
      }
      xmlString = document.asXML();
        try {
        //ContentServiceProxy proxy=new ContentServiceProxy(user,session);
        ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
        String result=proxy.saveObjectTemplate( documentId, templateName, xmlString);
          //byte[] response = sbiutils.saveObjectTemplate(spagoBIBaseUrl, path, templateName, xmlString);
View Full Code Here


        document = reader.read(is);
      } catch (Exception e) {
        logger.error("Error while parsing xml template " + xmlString, e);
        return;
      }
      xmlString = document.asXML();
        try {
      //ContentServiceProxy proxy=new ContentServiceProxy(user,session);
      ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
      String result=proxy.saveObjectTemplate( documentId, templateName, xmlString);
        } catch (Exception gse) {   
View Full Code Here

  private void loadDatasourcesFromXml(String dataSources) {
    EntityResolver loader = new PentahoEntityResolver();
    Document doc = null;
    try {
      doc = XmlDom4JHelper.getDocFromFile(dataSources, loader);
      String modified = doc.asXML();
      doc = XmlDom4JHelper.getDocFromString(modified, loader);

      List<Node> nodes = doc.selectNodes("/DataSources/DataSource/Catalogs/Catalog"); //$NON-NLS-1$
      int nr = 0;
      for (Node node : nodes) {
View Full Code Here

    if (LOG.isDebugEnabled()) {
      if (doc == null) {
        LOG.debug("Original Document is null");
      }
      else {
        LOG.debug("Original Document:" + doc.asXML()); //$NON-NLS-1$
      }
    }


View Full Code Here

    // Make sure we can cache these Document objects...
    Document user1Document = DocumentHelper.createDocument();
    Element user1RootNode = user1Document.addElement( "user1" ); //$NON-NLS-1$
    Element user1FileNode = user1RootNode.addElement( "file" ); //$NON-NLS-1$
    user1FileNode.addAttribute( "name", "test" ); //$NON-NLS-1$ //$NON-NLS-2$
    String user1CompareXMLOriginal = user1Document.asXML();

    // User2's Objects
    // Cache any-old String...
    String user2StringObject = "User2's String Object"; //$NON-NLS-1$
    Document user2Document = DocumentHelper.createDocument();
View Full Code Here

    String user2StringObject = "User2's String Object"; //$NON-NLS-1$
    Document user2Document = DocumentHelper.createDocument();
    Element user2RootNode = user2Document.addElement( "user2" ); //$NON-NLS-1$
    Element user2FileNode = user2RootNode.addElement( "folder" ); //$NON-NLS-1$
    user2FileNode.addAttribute( "name", "test2" ); //$NON-NLS-1$ //$NON-NLS-2$
    String user2CompareXMLOriginal = user2Document.asXML();

    // Global Objects
    Integer globalInt = new Integer( 372 );
    BigDecimal globalBigDecimal = new BigDecimal( "2342.123334444211" ); //$NON-NLS-1$
    StringBuffer globalStringBuffer = new StringBuffer();
View Full Code Here

    // Make sure we can cache these Document objects...
    Document user1Document = DocumentHelper.createDocument();
    Element user1RootNode = user1Document.addElement( "user1" ); //$NON-NLS-1$
    Element user1FileNode = user1RootNode.addElement( "file" ); //$NON-NLS-1$
    user1FileNode.addAttribute( "name", "test" ); //$NON-NLS-1$ //$NON-NLS-2$
    String user1CompareXMLOriginal = user1Document.asXML();

    // User2's Objects
    // Cache any-old String...
    String user2StringObject = "User2's String Object"; //$NON-NLS-1$
    Document user2Document = DocumentHelper.createDocument();
View Full Code Here

    String user2StringObject = "User2's String Object"; //$NON-NLS-1$
    Document user2Document = DocumentHelper.createDocument();
    Element user2RootNode = user2Document.addElement( "user2" ); //$NON-NLS-1$
    Element user2FileNode = user2RootNode.addElement( "folder" ); //$NON-NLS-1$
    user2FileNode.addAttribute( "name", "test2" ); //$NON-NLS-1$ //$NON-NLS-2$
    String user2CompareXMLOriginal = user2Document.asXML();

    // Global Objects
    Integer globalInt = new Integer( 372 );
    BigDecimal globalBigDecimal = new BigDecimal( "2342.123334444211" ); //$NON-NLS-1$
    StringBuffer globalStringBuffer = new StringBuffer();
View Full Code Here

      Document document =
          XmlDom4JHelper.getDocFromString( "<?xml version=\"1.0\" encoding=\"windows-1252\"?><root></root>", null ); //$NON-NLS-1$
      Assert.assertEquals( document.getRootElement().getName(), "root" ); //$NON-NLS-1$

      StringBuffer content =
          XmlHelper.transformXml( parameterXsl, xslPath, document.asXML(), parameters, new JarEntityResolver() );
      System.out.println( "Transformed XML" + content ); //$NON-NLS-1$

    } catch ( Exception e ) {
      e.printStackTrace();
      Assert.assertTrue( "Exception thrown " + e.getMessage(), false ); //$NON-NLS-1$
View Full Code Here

              "Body" + "</filters>"; //$NON-NLS-1$ //$NON-NLS-2$

      Document document = XmlDom4JHelper.getDocFromString( xmlString, null );

      StringBuffer content =
          XmlHelper.transformXml( parameterXsl, xslPath, document.asXML(), parameters, new JarEntityResolver() );
      System.out.println( "Transformed XML" + content ); //$NON-NLS-1$
    } catch ( Exception e ) {
      e.printStackTrace();
      Assert.assertTrue( "Exception thrown " + e.getMessage(), false ); //$NON-NLS-1$
    }
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.