Package org.dom4j

Examples of org.dom4j.Document.asXML()


      if ( document != null ) {
        // next try with orm 2.0 xsd validation
        try {
          setValidationFor( saxReader, "orm_2_0.xsd" );
          document = saxReader.read( new StringReader( document.asXML() ) );
          if ( errorHandler.hasErrors() ) {
            errorHandler.logErrors();
            throw errorHandler.getErrors().get( 0 );
          }
          return new XmlDocumentImpl( document, origin.getType(), origin.getName() );
View Full Code Here


          if ( document != null ) {
            // next try with orm 1.0 xsd validation
            try {
              setValidationFor( saxReader, "orm_1_0.xsd" );
              document = saxReader.read( new StringReader( document.asXML() ) );
              if ( errorHandler.hasErrors() ) {
                errorHandler.logErrors();
                throw errorHandler.getErrors().get( 0 );
              }
              return new XmlDocumentImpl( document, origin.getType(), origin.getName() );
View Full Code Here

      if ( document != null ) {
        // next try with orm 1.0 xsd validation
        try {
          setValidationFor( saxReader, "orm_1_0.xsd" );
          document = saxReader.readnew StringReader( document.asXML() ) );
          if ( errorHandler.getError() != null ) {
            throw errorHandler.getError();
          }
          return new XmlDocumentImpl( document, origin.getType(), origin.getName() );
        }
View Full Code Here

      if ( document != null ) {
        // next try with orm 1.0 xsd validation
        try {
          setValidationFor( saxReader, "orm_1_0.xsd" );
          document = saxReader.readnew StringReader( document.asXML() ) );
          if ( errorHandler.error != null ) {
            throw errorHandler.error;
          }
          return buildMetadataXml( document, source.getOrigin().getType(), source.getOrigin().getName() );
        }
View Full Code Here

      if ( document != null ) {
        // next try with orm 1.0 xsd validation
        try {
          setValidationFor( saxReader, "orm_1_0.xsd" );
          document = saxReader.read( new StringReader( document.asXML() ) );
          if ( errorHandler.hasErrors() ) {
            errorHandler.logErrors();
            throw errorHandler.getErrors().get( 0 );
          }
          return new XmlDocumentImpl( document, origin.getType(), origin.getName() );
View Full Code Here

      if ( document != null ) {
        // next try with orm 1.0 xsd validation
        try {
          setValidationFor( saxReader, "orm_1_0.xsd" );
          document = saxReader.readnew StringReader( document.asXML() ) );
          if ( errorHandler.getError() != null ) {
            throw errorHandler.getError();
          }
          return new XmlDocumentImpl( document, origin.getType(), origin.getName() );
        }
View Full Code Here

    public void testGraphAsXML_Same() {
        try {
            SAXReader saxReader = new SAXReader();
            Document document = saxReader.read( getWorkflow() );

            assertEquals( document.asXML(), businessProcess.getGraphAsXML() );
        } catch( DocumentException e ) {
            fail( e.getMessage() );
        }
    }
View Full Code Here

        SAXReader reader = new SAXReader();

        try {
            Document d = reader.read(doc);

            graph.setGraphAsXML(d.asXML());

            graph.setName(d.getRootElement().attribute("name").getValue());

            Element e = (Element) d.getRootElement().selectSingleNode("graph");
View Full Code Here

            m.remove(m.attribute("script"));
            Document d = m.getDocument();
            d.addDocType("channel-definition", null, "channelDefinition.dtd");

            String xml = d.asXML();
            InputStream inpt = new ByteArrayInputStream(xml.getBytes());
            IChannelPublisher pub = ChannelPublisher.getCommandLineInstance();
            pub.publishChannel(inpt);

        } catch (Throwable t) {
View Full Code Here

                "location", "US").addText("Bob McWhirter");
        // now that we have something to process, we compare the origial version
        // 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

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.