There is a code:
public void startElement(String uri, String localName,String qName, Attributes attributes) throws SAXException { System.out.println("Start Element :" + qName); if (qName.equalsIgnoreCase("узел1")) { Узел1 = true; } Here I extract the value for this XML document construction:
<узел1>value</узел1> I get this value with the following code:
public void characters(char ch[], int start, int length) throws SAXException { if (Узел1) { System.out.println("Узел1 : " + new String(ch, start, length)); Узел1 = false; } Everything is good and beautiful, but I would like to implement the work with attributes on the following XML document structure:
<Узел атрибут = "это значение надо достать" атриубт2="и это тоже"/> How to implement it?