Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:21:30+00:00 2026-05-23T01:21:30+00:00

I am extending org.xml.sax.helpers.DefaultHandler to parse a XML. How can you determine the depth

  • 0

I am extending org.xml.sax.helpers.DefaultHandler to parse a XML.
How can you determine the depth level during parsing?

for example:

<?xml version="1.0" encoding="utf-8"?>
<jsk:Dataset gml:id="Dataset1" ....>
    <gml:description>....</gml:description>
    <gml:boundedBy>
        ...
    </gml:boundedBy>
</jsk:Dataset>

<jsk:Dataset> tag is on level 0

<gml:description> and <gml:boundedBy> tags are on level 1 and so on…

any guidance on the right direction is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:21:30+00:00Added an answer on May 23, 2026 at 1:21 am

    The DefaultHandler class indicates that it is processing a new element via the startElement method, and that it has finished processing the same using the endElement method. You can hook onto these methods by overriding them in your child class.

    The approach stated in the other answer of using an instance field to store state can be used in this case as well. Increment on entering startElement and decrement on exiting endElement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For parsing an xml response using TagSoup I am extending the DefaultHandler, now I
This is a simple example from the python documentation (http://docs.python.org/extending/extending.html): static PyObject * spam_system(PyObject
I have two filter classes extending from org.springframework.web.filter.RequestContextFilter , both configured in the web.xml
I found this example: http://www.yaml.org/YAML_for_ruby.html#extending_kernel::hash It's nice to see how easy YAML can serialize
So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html Here is the example: <definition name=myapp.homepage template=/layouts/classic.jsp> <put-attribute name=title
Hey, I'm trying to get this nav working nicely: http://www.moreheadplanetarium.org/redesign/nav.html I can't figure out
I'm trying to figure out how to compile Python modules in C ( http://docs.python.org/extending/extending.html
Upon extending the excellent django project django-profiles (found on https://bitbucket.org/ubernostrum/django-profiles/wiki/Home ) I stumbled upon
EDIT: looking for this: http://diminishing.org/extending-formtastic-with-a-sprinkle-of-jquery (If this works I'll answer my own question) I've
I'm developping a plugin for eclipse and extending the org.eclipse.ui.views extension point. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.