#40 bug endElement()

SAX_2.0
closed-rejected
nobody
5
2002-03-19
2002-03-19
Anonymous
No

In my class MyContentHandler that implements
ContentHandler

In method :
public void endElement(String sNamespaceURI, String
sLocalName,String sRawName) throws SAXException
{

// end group
this.sKey = sLocalName;

// tag TRTACTION
if ( this.sKey.equals("TRTACTION") )
{
this.hTrt.put(this.sKey,this.sValue);
System.out.println
("Key : "+this.sKey+" \nValue : "+this.sValue);
return;
}
}

In my xml file I have :
<TRTACTION>coucou1</TRTACTION>
<TRTACTION>coucou2</TRTACTION>
<TRTACTION>coucou3</TRTACTION>
<TRTACTION>coucou4</TRTACTION>

Every time during extraction I have :
'coucou1'
'coucou2'
'couc'
'coucou4'

Except if I change order...
<TRTACTION>coucou1</TRTACTION>
<TRTACTION>coucou3</TRTACTION>
<TRTACTION>coucou2</TRTACTION>
<TRTACTION>coucou4</TRTACTION>

'coucou1'
'couc'
'coucou2'
'coucou4'

What's hap, guys ???
SAX is very sensitive with '\t' ... ???

/Nexus6

--
!

Discussion

  • David Brownell
    David Brownell
    2002-03-19

    Logged In: YES
    user_id=44117

    This isn't a SAX bug.

    There's a chance it MIGHT be a bug in some
    particular SAX parser implementation.

    I say MIGHT because it's very likely that
    the bug is in the program ... it's quite legal
    to report characters() in multiple callbacks,
    and the sample code clearly doesn't handle that
    case. Plus, the submitted report suggests
    there's a '\t' issue, but there's none in the
    sample text ... so it's clear the report does
    not accurately describe the problem seen.

     
  • David Brownell
    David Brownell
    2002-03-19

    • status: open --> closed-rejected