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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Searching for attributes

843834Jun 15 2001 — edited Jun 15 2001
I'm using SaxParser and trying to identify an attibute, the line in the xml document looks like this:
<question id="q001" type="single_answer" status="enable">

In my parser I've tried to locate the "type" attribute
with:
public void startElement (String uri, String name,
String qName, Attributes atts)
{
//System.out.println("Start element: {" + uri + "}" + name);
////////////////////////////////////////////////////////////////////////////////////////////////////

String question_type = atts.getType("id");
System.out.println(question_type);

if( name.equals("question_text")){
XMLquestion_text_counter++;
System.out.println(XMLquestion_text_counter);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////

}

Keeps coming back null
Can anyone shed some light on why?
Learning this as I go.
Thanks
Jim

Comments

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

Post Details

Locked on Jul 13 2001
Added on Jun 15 2001
1 comment
60 views