Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What am I missing here?

843834Jun 17 2001 — edited Jun 18 2001
Take a look at this code, I'm trying to extract the value of the tag<question_text>Some question</question_text> from my xml document, I get the question text, but everthing else along with it.


public void startElement (String uri, String name,
String qName, Attributes atts)
{

if( name.equals("question_text")){

question_text = true;

}// close if
}//close start element

public void characters (char ch[], int start, int length)
{


if(question_text){
String question = new String(ch).substring(start,start + length);
System.out.println( question );
}// close if
}//close characters

Can't seem to isolate just the question_text
TIA
Jim

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 16 2001
Added on Jun 17 2001
2 comments
64 views