Neil M. wrote: > Hi, does anyone on the list know Java? I've got this nasty little bug > I'm trying to figure out. When I parse the XML in the metalink file it > calls the endElement but not the startElement, I have no idea why or how > that could be. Code in subversion: > > [snip link] > > The "in sax start" line never prints, the endElement print statement does.
You are importing the wrong Attributes. So you are writing a new method with the signature: public void startElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.util.jar.Attributes attributes) instead of overriding the existing method in DefaultHandler, which has the signature: public void startElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes) and SAX tries to call a method with the latter signature. Since you didn't override it, the dummy implementation in DefaultHandler is called. Solution: import org.xml.sax.Attributes instead of java.util.jar.Attributes (which is a completely unrelated class). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Metalink Discussion" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/metalink-discussion?hl=en -~----------~----~----~----~------~----~------~--~---
