Return-Path: Delivered-To: apmail-ws-commons-dev-archive@locus.apache.org Received: (qmail 72382 invoked from network); 3 Mar 2008 11:55:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 11:55:59 -0000 Received: (qmail 79417 invoked by uid 500); 3 Mar 2008 11:55:55 -0000 Delivered-To: apmail-ws-commons-dev-archive@ws.apache.org Received: (qmail 79399 invoked by uid 500); 3 Mar 2008 11:55:55 -0000 Mailing-List: contact commons-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commons-dev@ws.apache.org Delivered-To: mailing list commons-dev@ws.apache.org Received: (qmail 79389 invoked by uid 99); 3 Mar 2008 11:55:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 03:55:55 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 11:55:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5635B234C05C for ; Mon, 3 Mar 2008 03:54:51 -0800 (PST) Message-ID: <759775158.1204545291351.JavaMail.jira@brutus> Date: Mon, 3 Mar 2008 03:54:51 -0800 (PST) From: "Hiranya Jayathilaka (JIRA)" To: commons-dev@ws.apache.org Subject: [jira] Commented: (WSCOMMONS-305) OMElementImpl.getText() returns an empty String for text in CDATA tags In-Reply-To: <1799400890.1204544930558.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/WSCOMMONS-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574454#action_12574454 ] Hiranya Jayathilaka commented on WSCOMMONS-305: ----------------------------------------------- Simply extending the test to include CDATA elements will solve the problem of traversing structures with CDATA tags. public String getText() { String childText = null; StringBuffer buffer = null; OMNode child = this.getFirstOMChild(); while (child != null) { if (child.getType() == OMNode.TEXT_NODE || child.getType() == OMNode.CDATA_SECTION_NODE) { OMText textNode = (OMText) child; String textValue = textNode.getText(); ............. > OMElementImpl.getText() returns an empty String for text in CDATA tags > ---------------------------------------------------------------------- > > Key: WSCOMMONS-305 > URL: https://issues.apache.org/jira/browse/WSCOMMONS-305 > Project: WS-Commons > Issue Type: Improvement > Components: AXIOM > Environment: any > Reporter: Hiranya Jayathilaka > > AXIOM supports building OM structures with CDATA elements. For an example something like, > soapFactory.createOMText(parentNode, "some text",XMLStreamConstants.CDATA); > is perfectly valid and delivers the expected result. But when traversing such an OM structure calling parentNode.getText() returns an empty String. Instead it would have been better if it returned the String without the CDATA tags. For an example calling getText() on an element like, > > should return the String, "some text". -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org For additional commands, e-mail: commons-dev-help@ws.apache.org