Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 78908 invoked from network); 17 Apr 2006 17:10:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Apr 2006 17:10:21 -0000 Received: (qmail 78732 invoked by uid 500); 17 Apr 2006 17:10:18 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 78683 invoked by uid 500); 17 Apr 2006 17:10:17 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 78671 invoked by uid 99); 17 Apr 2006 17:10:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2006 10:10:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2006 10:10:16 -0700 Received: from brutus (localhost.localdomain [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EEBD441000A for ; Mon, 17 Apr 2006 17:09:18 +0000 (GMT) Message-ID: <7608965.1145293758968.JavaMail.jira@brutus> Date: Mon, 17 Apr 2006 17:09:18 +0000 (GMT+00:00) From: "Ruchith Udayanga Fernando (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-565) Namespace vanishes using StAXOMBuilder In-Reply-To: <1764038278.1144838000016.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXIS2-565?page=comments#action_12374784 ] Ruchith Udayanga Fernando commented on AXIS2-565: ------------------------------------------------- Well.. I just tried out the following test case with the latest axiom code: public class Axis2Test extends TestCase { public Axis2Test(String string) { super(string); } public void testNameSpaces() { StringBuffer sb = new StringBuffer(); sb.append(""); sb.append(" Some text"); sb.append(" More test"); sb.append(" "); sb.append(" redMy fine item"); sb.append(" blueSomething else"); sb.append(" "); sb.append(" "); sb.append(" rectangle"); sb.append(" circle"); sb.append(" square"); sb.append(" "); sb.append(""); try { System.out.println("ORIGINAL:\n" + sb.toString()); XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(sb.toString())); StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),parser); String result = builder.getDocumentElement().toString(); System.out.println("AXIOM:\n" + result); assertEquals(sb.toString(),result); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } } } The failure in string comparison is alright since IMHO we cannot guarantee the order of the namespaces in serialized OM will be the same as the source (can we ??) . BUT the output to the STDOUT from the above test case was: ORIGINAL: Some text More test redMy fine item blueSomething else rectangle circle square AXIOM: Some text More test redMy fine item blueSomething else rectangle circle square The two xml's are clearly different since there are duplicate namespace declarations (in the color element, which is not required since its declared in the parent) in the one produced by serializing AXIOM. Even though this issue is there, since the security integration test cases runs without a problem and since I was able to successfully run the interop scenarios with the external wsse 1.0 endpoints (i.e. seems like no c14n problems), I don't think the problem of duplicate ns declarations need to be fixed at this point. > Namespace vanishes using StAXOMBuilder > -------------------------------------- > > Key: AXIS2-565 > URL: http://issues.apache.org/jira/browse/AXIS2-565 > Project: Apache Axis 2.0 (Axis2) > Type: Bug > Versions: 0.95 > Environment: Windows XP, Java 1.5 > Reporter: Ant Grinyer > Assignee: Eran Chinthaka > > Below is the simple Junit test code which demonstrates the bug comments: > package com.mytest; > import org.apache.ws.commons.om.impl.builder.StAXOMBuilder; > import org.apache.ws.commons.om.impl.llom.factory.OMXMLBuilderFactory; > import org.apache.ws.commons.om.OMAbstractFactory; > import org.jdom.Document; > import org.jdom.output.XMLOutputter; > import org.jdom.input.SAXBuilder; > import javax.xml.stream.XMLStreamReader; > import javax.xml.stream.XMLInputFactory; > import java.io.StringReader; > import junit.framework.TestCase; > /** > * Test class to demonstrate namespace problem. > * > * Date: 11-Apr-2006 > */ > public class Axis2Test extends TestCase { > public Axis2Test(String string) { super(string); } > protected void setUp() throws Exception { super.setUp(); } > protected void tearDown() throws Exception { super.tearDown(); } > public void testNameSpaces() { > StringBuffer sb = new StringBuffer(); > sb.append(""); > sb.append(" Some text"); > sb.append(" More test"); > sb.append(" "); > sb.append(" redMy fine item"); > sb.append(" blueSomething else"); > sb.append(" "); > sb.append(" "); > sb.append(" rectangle"); > sb.append(" circle"); > sb.append(" square"); > sb.append(" "); > sb.append(""); > try { > // TRY WITH AXIS2 (loses xmlns:col="urn:mycolor" namespace on > // the element > XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(sb.toString())); > StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),parser); > System.out.println(builder.getDocumentElement().toString()); > // TRY JDOM (works fine) > Document d = new SAXBuilder().build(new StringReader(sb.toString())); > new XMLOutputter().output(d, System.out); > } catch (Exception e) { > e.printStackTrace(System.out); > } > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira