Package org.jdom

Examples of org.jdom.CDATA


        Element conditionElement = new Element("condition");
        element.addContent(conditionElement);
        if (this.condition != null) {
            String condition = StringUtil.replace(this.condition, "\n", "<br>");
            condition = StringUtil.replace(condition, "  ", "<sp>");
            CDATA cdata = new CDATA(condition);
            conditionElement.setContent(cdata);
        }
    }
View Full Code Here


            modificationElement.addContent(userElement);
        }

        if (comment != null) {
            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(commentElement);
        }
View Full Code Here

            Element projectElement = new Element(TAGNAME_PROJECT);
            projectElement.addContent(project);
            element.addContent(projectElement);

            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);
            element.addContent(commentElement);
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

            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

            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

        if (node instanceof Element) {
            arg = ((Element) node).getName();
        } else if (node instanceof Attribute) {
            arg = ((Attribute) node).getName();
        } else if (node instanceof CDATA) {
            CDATA cDATA = (CDATA) node;
            arg = cDATA.getParent().getName();
        } else if (node instanceof Text) {
            Text text = (Text) node;
            arg = text.getParent().getName();
        } else {
            // this should never happen as the XPath should always refer to
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

     * this method prints the XML request body attribute.
     */
    private Element printXMLrequestBody(){
        Element bodyElem = new Element( "body" );
        try {
            bodyElem.addContent( new CDATA(request.getRequestBody()) );
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return bodyElem;
View Full Code Here

     * this method prints the XML response body attribute.
     */
    private Element printXMLresponseBody() {
        Element bodyElem = new Element( "body" );
        try {
            bodyElem.addContent( new CDATA(response.getResponseBody()) );
        } catch ( IOException e ) {
            e.printStackTrace();
        }
        return bodyElem;
    }
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.