[Biojava-l] unexpected behavior in StAX, StringElementHandlerBase

Thomas Down td2@sanger.ac.uk
Tue, 18 Sep 2001 16:14:39 +0100


On Tue, Sep 18, 2001 at 10:50:13AM -0400, Michael L. Heuer wrote:
> 
> All,
> 
> Perhaps I'm making an incorrect assumption, but shouldn't a String
> element handler return the string value of just the current element?  I'm
> seeing a concatenation of all the values:
> 
>  [java] There was 1 failure:
>  [java] 1) testStringElementHandlerBase(ConfusedStAXHandlerTest) "expected:<d> but was:<abcd>"


Okay, you've got a good point here.  I'm not really used
to XML with mixed content models (other than HTML, obviously...),
but I think you're probably right in saying that StringElementHandlerBase
should just return the immediate child string.  What I'm not
so clear about is whether it should tolerate (and silently ignore)
child elements, or whether it should fail when it encounters
a startElement.  I'm actually inclined to think the latter, but
I'm quite open to suggestions on this.

   Thomas.