Package org.jdom

Examples of org.jdom.CDATA


        dateElement.addContent(formatter.format(modifiedTime));
        Element userElement = new Element(TAGNAME_USER);
        userElement.addContent(userName);
        Element commentElement = new Element(TAGNAME_COMMENT);

        CDATA cd;
        try {
            cd = new CDATA(comment);
        } catch (org.jdom.IllegalDataException e) {
            LOG.error(e);
            cd = new CDATA("Unable to parse comment.  It contains illegal data.");
        }
        commentElement.addContent(cd);

        modificationElement.addContent(dateElement);
        modificationElement.addContent(userElement);
View Full Code Here


                    && !line.startsWith("\t")) {
                makeNewCurrentElement(line.substring(0, line.lastIndexOf(':')));
                return; // Do not log the goal itself
            }
            Element msg = new Element("message");
            msg.addContent(new CDATA(line));
            // Initially call it "info" level.
            // If "the going gets tough" we'll switch this to "error"
            msg.setAttribute("priority", "info");
            if (currentElement == null) {
                buildLogElement.addContent(msg);
View Full Code Here

        try {
            buildLogElement = builder.translateNantErrorElements(buildLogElement);
            fail("Expected a CruiseControlException for invalid nant log output format");
        } catch (CruiseControlException e) { /** expected **/ }

        messageElement.setContent(new CDATA("test failure"));

        buildLogElement = builder.translateNantErrorElements(buildLogElement);
        assertEquals("build", buildLogElement.getName());
        Attribute errorAttribute = buildLogElement.getAttribute("error");
        assertTrue(errorAttribute != null);
View Full Code Here

    String shell = env.getShell();
    if (shell != null && !shell.equals(ScriptEnvironment.UNKNOWN_SHELL))
      elem.setAttribute("shell", shell);

    //script:
    elem.addContent(new CDATA(script.getText()));

  }
View Full Code Here

     
      while (currentEvent.getEventType() != XMLEvent.END_ELEMENT) {
         
          switch (currentEvent.getEventType()) {
              case XMLStreamConstants.CDATA:
                  element.addContent(new CDATA(currentEvent.asCharacters().getData()));
                  break;
 
              case XMLStreamConstants.SPACE:
              case XMLStreamConstants.CHARACTERS:
                  element.addContent(new Text(currentEvent.asCharacters().getData()));
View Full Code Here

                    Document d =
                        new SAXBuilder().build( new StringReader(objectLockToken.getOwnerInfo()) );
                    owner.addContent(d.getRootElement());
                }
                catch( Throwable e ) {
                    owner.addContent(new CDATA(objectLockToken.getOwnerInfo()));
                }
            }
           
            Element timeout = new Element(E_TIMEOUT, DNSP);
            activelock.addContent(timeout);
View Full Code Here

    public void writeProcessingInstruction(String arg0, String arg1) throws XMLStreamException {
    }

    public void writeCData(String data) throws XMLStreamException {
        currentNode.addContent(new CDATA(data));
    }
View Full Code Here

    public void writeProcessingInstruction(String arg0, String arg1) throws XMLStreamException {
    }

    public void writeCData(String data) throws XMLStreamException {
        currentNode.addContent(new CDATA(data));
    }
View Full Code Here

            Comment c = (Comment) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
        for ( Iterator<?> i = document.getDescendants( new ContentFilter( ContentFilter.CDATA ) ); i.hasNext(); )
        {
            CDATA c = (CDATA) i.next();
            c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) );
        }
    }
View Full Code Here

            addProperty(properties, TEST_PAGE_NAME, browserResult.getTestPageName());
            addProperty(properties, USER_PROPERTY, browserResult.getUserProperty());
        }
        if (browserResult.hasServerSideExceptionStackTrace()) {
            Element stackTrace = createPropertyElement(SERVER_SIDE_EXCEPTION_STACK_TRACE);
            stackTrace.addContent(new CDATA(browserResult.getServerSideExceptionStackTrace()));
            properties.addContent(stackTrace);
        }
    }
View Full Code Here

TOP

Related Classes of org.jdom.CDATA

Copyright © 2018 www.massapicom. 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.