Comments (6)
It is supposed that error messages should provide proper location information, and there is some infrastructure for that in the parser, but I think it is somewhat broken. I want to rework it one day. Exposing it is probably a good idea, but the proper way to do it also should be thought out properly because of event-based parsing approach.
I'll add it to my to-do list.
from xml-rs.
Yes, error messages seem to work as expected. I was more thinking about making this information available to the code that invokes the parser to show in errors caused by program logic not parsing logic, i.e., the parsed xml is syntactically correct but is not what is expected by the program. Findind out which of the thousands of tags in an xml document is formatted incorrectly without having to go through all of them by hand is very useful.
Thanks for looking into this!
from xml-rs.
Yes, I understand what you mean. As I said, this positioning code is not exactly correct, so I want to fix it first and then expose it to external consumers.
from xml-rs.
@netvl
So what's the plan on this? Should an event be carrying its position or should the parser provide the position of the last event?
from xml-rs.
@gkoz, I don't have any plans right now. I'm very sorry, but I'm very busy at my main job and I'm also working on my PhD thesis and several articles, all at the same time, so I just physically cannot work on side projects now :(
As a general thought, I don't want to add additional fields to events. Either the parser should provide a method to access the current position or there should be another iterator which returns (Event, Position)
where Position: common::HasPosition
.
from xml-rs.
@gkoz Thanks a lot!
from xml-rs.
Related Issues (20)
- Overflow in lexer when parsing malformed doctype HOT 1
- Fails to parse /> as part of XML body HOT 7
- Implement the position trait for the Events Iterator
- panicked at 'attempt to add with overflow' HOT 2
- Feature request: common Error enum for read/write
- Restricted XmlEvent? HOT 1
- [Question] How to implement streaming parsing? HOT 1
- deprecation warnings HOT 1
- Is this crate abandoned? HOT 3
- Parsing of comments <!-- <!-->
- Maintenance of xml-rs HOT 10
- EventReader never return Result::Err after document end HOT 1
- Version 0.8.9 broke deserialization behavior HOT 2
- 0.8.12's field types in xml::common::TextPosition break existing code HOT 1
- Panic in `PullParser::push_pos()` HOT 1
- You've found a bug in xml-rs, caused by calls to push_pos() HOT 3
- Profile-Guided Optimization (PGO) results HOT 2
- Simple way to remove whitespaces HOT 1
- Deal with files that start with empty line HOT 2
- Add default "xmlns" on ParserConfig2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xml-rs.