Skip to content
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

XML Processor breaks in android #1158

Open
skbeh opened this issue Jan 18, 2022 · 5 comments
Open

XML Processor breaks in android #1158

skbeh opened this issue Jan 18, 2022 · 5 comments
Labels
Android Issues related to running Rhino on Android docs Issues containing stuff that ought to be documented

Comments

@skbeh
Copy link

skbeh commented Jan 18, 2022

According to https://stackoverflow.com/questions/33337995/android-dom-xml-parser-that-supports-feature-secure-processing, DOM XML parser in android doesn't support FEATURE_SECURE_PROCESSING, so the processor breaks after Rhino 1.7.12 released.

@p-bakker p-bakker added the Android Issues related to running Rhino on Android label Jan 18, 2022
@p-bakker
Copy link
Collaborator

Are you sure it's related to that commit? The changes that introduced the dependancy on FEATURE_SECURE_PROCESSING date back to 2019, to Rhino 1.7.12 if I'm not mistaken.

The SO link you included suggests to use xerces-for-android though

@tonygermano
Copy link
Contributor

The shared commit appears to only reformat the code and not make any changes.

@skbeh
Copy link
Author

skbeh commented Jan 19, 2022

I can confirm that the problem was introduced in Rhino 1.7.12 with

dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);

@p-bakker p-bakker added the docs Issues containing stuff that ought to be documented label Jan 19, 2022
@p-bakker
Copy link
Collaborator

Had another look: this isn't a bug, because the both lines of codes that you say break compatibility are behind a feature flag (Context.FEATURE_ENABLE_XML_SECURE_PARSING), which defaults to true.

So, I think if you don't want to bundle and use the aforementioned 'xerces-for-android' and get secure XML processing, you can customize your Context and set the 'Context.FEATURE_ENABLE_XML_SECURE_PARSING' flag to false.

I'm leaving this case open for now, as we should document this (blocked by #954)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to running Rhino on Android docs Issues containing stuff that ought to be documented
Projects
None yet
Development

No branches or pull requests

3 participants