I have these XML on a URL
John&
Also to get the attributes from an element you can use something like this: You get the attributes from the atts Attributes in the startElement method.
}else if (localName.equals("Phone")){
this.in_Phone=true;
int length = atts.getLength();
System.out.println("length = " + length);
for(int i = 0; i < length; i++){
String name = atts.getQName(i);
System.out.println(name);
String value = atts.getValue(i);
System.out.println(value);
if(name.equals("loc")){
if(value.equals("home")){
this.in_homePhone=true;
}else if(value.equals("work")){
this.in_workPhone=true;
}else if(value.equals("mobile")){
this.in_mobilePhone=true;
}
}
}
}