Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

startElement not called, why not?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Xerces 1.3* to parse a public XML feed.



startDocument runs, but startElement never does:



I also tried what I think is the older now-deprecated syntax:



So, why isn't the method running?


* Yes I know it's old. I am stuck using jdk 1.3; a newer jdk is *not* an option. Hence the old Xerces.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which "AttributeList" have you imported? If you chose the wrong one then you have overloaded the startElement method rather than overriding it.

Actually... you're implementing HandlerBase? Then the signature for startElement is
 
Thomas Kennedy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my HandlerBase I'm importing org.xml.sax.AttributeList.

My understanding is that the signature (String,String,String,AttributeList) is deprecated. So I tried putting both versions in my handler:

(String,String,String,AttributeList)
(String,String,String,Attributes) (meaning of course I also import org.xml.sax.Attributes)

but neither one is invoked. I also made the signature explicit just in case there is another AttributeList in my classpath somewhere:

(String,String,String,org.xml.sax.AttributeList)
 
We noticed he had no friends. So we gave him this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!