-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.5.2 Feature Request: Reader parse-only mode. #103
Comments
Does the parsing stop because an exception is raised by the parser? In that case I can add an option to continue parsing and not stop by raising an error. Also, have you verified your ARXML file against the schema file before trying to parse? Finally, the new code base is still in early development. I haven't tried it myself yet to parse any XML generated by other tool or script. I will start testing it later, somewhere after v0.5.4. |
Hi cogu, thanks for the response. ARXML input files mention r4.0 AUTOSAR_4-2-2. The problem is definitely in our ARMXL which have duplicate entries. All errors reported by the Reader indicate that. Which is great. Just a convenience thing if you could ask to see all the parsing problems at once. Low hanging fruit for when you have time (haha). Thanks! |
When I have time I plan to add a boolean flag to the reader class named something like "stop_on_error" which defaults to True. But before I can add that I have to refactor all the places in the Reader code that raises an exception to only print a warning based on this flag. It's gonna take some time to do. |
Hi Conny,
Thank you for giving this some thought and committing to add it. If you
don't mind, I'll take a crack at making the changes you propose and see if
I can make progress.
…-r
On Fri, Mar 29, 2024 at 6:31 AM Conny Gustafsson ***@***.***> wrote:
When I have time I plan to add a boolean flag to the reader class named
something like "stop_on_error" which defaults to True.
Manually setting it to False should get the effect you want.
But before I can add that I have to refactor all the places in the Reader
code that raises an exception to only print a warning based on this flag.
It's gonna take some time to do.
—
Reply to this email directly, view it on GitHub
<#103 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHVSC3A56QGZIZWRLAYJS3Y2VNLXAVCNFSM6AAAAABDIZGUW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGI2DSMZVGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@rcd09, Actually when I think about it I would prefer to keep most of the exceptions and instead catch them in a try-except block in the method
I can make the change to the |
@qg020, @rcd09, I've made a first attempt of the change on latest master. There is still a lot of improvements that can be made but it should be good enough for now. I decided to let stop_on_error be False as default. Now you have to explicitly set it to True to stop reading the XML. See print_errors.py example with an invalid ARXML containing duplicates. |
I am reading ARXML we have generated and it is not to the Reader's liking. I have iterated through fixing each raised exception. A nice feature would be a 'parse-only' flag that would return a list of all lines in an ARXML file needing attention and why it is a problem.
The text was updated successfully, but these errors were encountered: