• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Parser

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I'm using the SAX parser in my program. What I want to do is get the the position(line number, etc) of an error, just as many xml readers do when they try to validate an XML doc. So the parser throws an exception if, say, a > is missing on a field and says that such data is missing. This is a good start. However, I don't know how, and can't figure out how, to get the line number at the time of the exception so I can direct the user to a more concise area in the XML doc to fix.

Anyone know of some examples or how to go about doing this?
 
Frankey James
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frankey James wrote:So I'm using the SAX parser in my program. What I want to do is get the the position(line number, etc) of an error, just as many xml readers do when they try to validate an XML doc. So the parser throws an exception if, say, a > is missing on a field and says that such data is missing. This is a good start. However, I don't know how, and can't figure out how, to get the line number at the time of the exception so I can direct the user to a more concise area in the XML doc to fix.

Anyone know of some examples or how to go about doing this?



God dangit!!

I swear I looked and looked through the API, but didn't see the SAXParserException.

Anyways, that's the answer to my question....maybe it'll help someone else equally or less alert than I??

 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you waited for 9 minute and 9 seconds, you don't need to post a question
You're very quick
 
Ranch Hand
Posts: 106
Mac Mac OS X Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that's the kinda thing we all do

like:
[13:55]:
How can I know if there's an error in my program?

[13:56]:
forget it, i didn't looked at MyProgramException



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic