Note that there are some explanatory texts on larger screens.

plurals
  1. POSaxParser concatenation prob
    primarykey
    data
    text
    <p>I have an xml file that reads like</p> <pre><code>&lt;Event Id="258" Key="123456"&gt; &lt;SubEvent Id="1"&gt; Microsoft will begin selling its &amp;quot;Kinect&amp;quot; full-body motion-sensing game system from November 4, while Sony launched its &amp;quot;Move&amp;quot; motion-controlled gaming system on September 15. &lt;/SubEvent&gt; &lt;/Event&gt; </code></pre> <p>Part of the parser handler</p> <pre><code>public void startElement(String uri, String localName,String qName, Attributes atts) throws SAXException { if (qName.equalsIgnoreCase("event")) { scored = false; event = true; if (//my condition){ scored = true; } if (scored){ sb= new StringBuffer(); } } public void characters(char ch[], int start, int length) throws SAXException { if (event) { event = false; } if (subevent) { if (scored){ sb.append(new String(ch, start, length)); } subevent = false; } } </code></pre> <p>But this only returns " Microsoft will begin selling its "</p> <p>I read that the parser might do multiple characters calls. How do I concatenate the different calls together? Can you please explain the logic flow?</p> <p>Additional info: I did a print all of the elements, it appears that the rest of the sentence is not being called, why??</p> <pre><code> Start Element :Event Start Element :SubEvent SubEvent: Microsoft will begin selling its End Element :SubEvent End Element :Event Start Element :Event Start Element :SubEvent SubEvent: Nintendo will sell a new version of its DS handheld device that can play games and show movies in 3D without glasses sometime before March 2011. End Element :SubEvent End Element :Event </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload