Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 93827 invoked from network); 30 Aug 2005 17:40:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Aug 2005 17:40:48 -0000 Received: (qmail 21376 invoked by uid 500); 30 Aug 2005 17:40:45 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 21331 invoked by uid 500); 30 Aug 2005 17:40:44 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 21318 invoked by uid 99); 30 Aug 2005 17:40:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2005 10:40:44 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of aslom@cs.indiana.edu designates 129.79.246.27 as permitted sender) Received: from [129.79.246.27] (HELO whale.cs.indiana.edu) (129.79.246.27) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2005 10:41:00 -0700 Received: from [127.0.0.1] (rainier.extreme.indiana.edu [129.79.246.105]) by whale.cs.indiana.edu (8.12.11/8.12.11/IUCS_2.68) with ESMTP id j7UHeX0N022267; Tue, 30 Aug 2005 12:40:34 -0500 (EST) Message-ID: <4314999F.9040502@cs.indiana.edu> Date: Tue, 30 Aug 2005 12:38:39 -0500 From: Aleksander Slominski User-Agent: Mozilla Thunderbird 1.0.5 (Windows/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 To: stax_builders@yahoogroups.com CC: dims@apache.org, axis-cvs@ws.apache.org Subject: Re: [stax_builders] Re: CDATA Events in STAX parser References: <20050830153157.31908.qmail@web51604.mail.yahoo.com> In-Reply-To: <20050830153157.31908.qmail@web51604.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 recorded as http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=231 alek Davanum Srinivas wrote: >+1 to a separate property as is in sjsxp. > >thanks, >dims > >--- Aleksander Slominski wrote: > > > >>Davanum Srinivas wrote: >> >> >> >>>unfortunately does not work. I DID TRY latest SVN before opening the >>>bug report and i actually created the bug report with a patch :( >>> >>> >>> >>> >>... >> >> >> >>>Testcase: testCData(org.apache.axis2.om.SpacesTest): FAILED >>>org.custommonkey.xmlunit.Diff >>>[different] Expected node type '4' but was '3' - comparing >>>]]> at /foo[1]/doc[1]/text()[1] to >>>at /foo[1]/doc[1]/text()[1] >>> >>>junit.framework.AssertionFailedError: org.custommonkey.xmlunit.Diff >>>[different] Expected node type '4' but was '3' - comparing >>>]]> at /foo[1]/doc[1]/text()[1] to >>>at /foo[1]/doc[1]/text()[1] >>> >>> at org.custommonkey.xmlunit.XMLAssert.assertXMLEqual(XMLAssert.java:111) >>> at org.custommonkey.xmlunit.XMLTestCase.assertXMLEqual(XMLTestCase.java:180) >>> at org.apache.axis2.om.SpacesTest.checkOMConformance(SpacesTest.java:82) >>> at org.apache.axis2.om.SpacesTest.testCData(SpacesTest.java:49) >>> >>> >>> >>> >>> >>this is a bug/misfeature of current spec: >>http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=181 >> >>however why are you testing for CDATA? from XML Infoset point of view >>there is no CDATA only characters: >> >>http://www.w3.org/TR/xml-infoset/#omitted >>(...)The boundaries of CDATA marked sections.(...) >> >>and CDATA is essentially replaced with characters content inside CDATA: >> >>http://www.w3.org/TR/xml-infoset/#infoitem.character >> >>i am pretty sure that the effect of applying the patch would be to break >>RI parser compliance: >> >>1) the first change would make hasText() work differently than specified >>in JavaDoc: >> >>XMLStreamReader: >> /** >> * Return true if the current event has text, false otherwise >> * The following events have text: >> * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE >> */ >> public boolean hasText(); >> >>2) second change: as you can see in description of next() reporting >>CDATA content as characters is not allowed (even when isCoalescing is >>false ...): >> >> /** >> * Get next parsing event - a processor may return all contiguous >> * character data in a single chunk, or it may split it into several >>chunks. >> * If the property javax.xml.stream.isCoalescing is set to true >> * element content must be coalesced and only one CHARACTERS event >> * must be returned for contiguous element content or >> * CDATA Sections. >> * >> * By default entity references must be >> * expanded and reported transparently to the application. >> * An exception will be thrown if an entity reference cannot be expanded. >> * If element content is empty (i.e. content is "") then no CHARACTERS >>event will be reported. >> * >> *

Given the following XML:
>> * <foo><!--description-->content >>text<![CDATA[<greeting>Hello</greeting>]]>other >>content</foo>
>> * The behavior of calling next() when being on foo will be:
>> * 1- the comment (COMMENT)
>> * 2- then the characters section (CHARACTERS)
>> * 3- then the CDATA section (another CHARACTERS)
>> * 4- then the next characters section (another CHARACTERS)
>> * 5- then the END_ELEMENT
>> * >> *

NOTE: empty element (such as <tag/>) will be reported >> * with two separate events: START_ELEMENT, END_ELEMENT - This preserves >> * parsing equivalency of empty element to <tag></tag>. >> * >> * This method will throw an IllegalStateException if it is called >>after hasNext() returns false. >> * @see javax.xml.stream.events.XMLEvent >> * @return the integer code corresponding to the current parse event >> * @throws NoSuchElementException if this is called when hasNext() >>returns false >> * @throws XMLStreamException if there is an error processing the >>underlying XML source >> */ >> public int next() throws XMLStreamException; >> >>i think this problem (and few others) should be fixed in maintenance >>update of JSR 173 and as we can not currently change spec so parser impl >>must follow spec if if it is broken ... >>to this extent i opened meta issue: >>http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=230 >> >>i am open to some other suggestion - maybe custom property to turn on >>returning CDATA for stream reader? >> >>thanks, >> >>alek >> >> >> >>>On 8/30/05, Aleksander Slominski wrote: >>> >>> >>> >>> >>>>Dims, >>>> >>>>pelase check with lates StAX RI - i have built new JAR and dropped to >>>>http://dist.codehaus.org/stax/jars/ >>>>(and that should propagte later ot other maven repos) >>>> >>>>best, >>>> >>>>alek >>>> >>>>Davanum Srinivas wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Added a bug report with stax folks (http://jira.codehaus.org/browse/STAX-14) >>>>> >>>>>-- dims >>>>> >>>>>On 8/29/05, dims@apache.org wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Author: dims >>>>>>Date: Mon Aug 29 19:38:04 2005 >>>>>>New Revision: 264675 >>>>>> >>>>>>URL: http://svn.apache.org/viewcvs?rev=264675&view=rev >>>>>>Log: >>>>>>- sjsxp is no good :( as we can't re-distribute it >>>>>> >>>>>> >>(http://java.sun.com/webservices/docs/1.6/ReleaseNotes.html) >> >> >>>>>>- Get all the tests working again. EXCEPT SpacesTest (we're not getting the cdata events) >>>>>>- Get rid of unused Random member >>>>>> >>>>>> >>>>>>Modified: >>>>>> webservices/axis/trunk/java/modules/addressing/project.xml >>>>>> webservices/axis/trunk/java/modules/core/project.xml >>>>>> webservices/axis/trunk/java/modules/integration/project.xml >>>>>> webservices/axis/trunk/java/modules/saaj/project.xml >>>>>> webservices/axis/trunk/java/modules/samples/project.xml >>>>>> webservices/axis/trunk/java/modules/security/project.xml >>>>>> webservices/axis/trunk/java/modules/wsdl/project.xml >>>>>> webservices/axis/trunk/java/modules/xml/project.xml >>>>>> webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java >>>>>> >>>>>> >>>>>> >webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXBuilder.java > > >>>>>>Modified: webservices/axis/trunk/java/modules/addressing/project.xml >>>>>>URL: >>>>>> >>>>>> >http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/project.xml?rev=264675&r1=264674&r2=264675&view=diff > > >>>>>>============================================================================== >>>>>>--- webservices/axis/trunk/java/modules/addressing/project.xml (original) >>>>>>+++ webservices/axis/trunk/java/modules/addressing/project.xml Mon Aug 29 19:38:04 2005 >>>>>>@@ -66,17 +66,17 @@ >>>>>> http://dist.codehaus.org/stax/jars/ >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>- sjsxp >>>>>> >>>>>>- sjsxp >>>>>> >>>>>>- 1.6 >>>>>> >>>>>>+ stax >>>>>> >>>>>>+ stax >>>>>> >>>>>>+ 1.1.1-dev >>>>>> >>>>>> >>>>>> >>>>>> true >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>- sjsxp >>>>>> >>>>>> >>>>>> >=== message truncated === > > >Davanum Srinivas - http://webservices.apache.org/~dims/ > > > >____________________________________________________ >Start your day with Yahoo! - make it your home page >http://www.yahoo.com/r/hs > > > >------------------------ Yahoo! Groups Sponsor --------------------~--> >Fair play? Video games influencing politics. Click and talk back! >http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/NhFolB/TM >--------------------------------------------------------------------~-> > > >Yahoo! Groups Links > ><*> To visit your group on the web, go to: > http://groups.yahoo.com/group/stax_builders/ > ><*> To unsubscribe from this group, send an email to: > stax_builders-unsubscribe@yahoogroups.com > ><*> Your use of Yahoo! Groups is subject to: > http://docs.yahoo.com/info/terms/ > > > > > -- The best way to predict the future is to invent it - Alan Kay