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

JanusWeb is more sensitive to invalid XML than native #48

Closed
jbaicoianu opened this issue Mar 24, 2017 · 1 comment
Closed

JanusWeb is more sensitive to invalid XML than native #48

jbaicoianu opened this issue Mar 24, 2017 · 1 comment

Comments

@jbaicoianu
Copy link
Owner

jbaicoianu commented Mar 24, 2017

The XML parsing libraries browsers use for DOMParser is a lot more picky about XML validity than the one the JanusVR native client uses. Specifically, one error that frequently causes problems is duplicate attributes on objects, for example:

<Object scale="1 1 1" id="class3" pos="0 0 0" scale="1.1 1.1 1.1" />

Since "scale" is duplicated, strictly speaking this XML is invalid, but it would be nice if we could handle this gracefully.

At the very least we should detect xml parse errors and show a message to the user, rather than dumping them into an empty or partially-complete room. There's also the option of switching to a pure-js XML parser, but this would make XML parsing slower across the board.

Another option worth considering is the idea of running the XML through an XSLT transform before trying to parse it. It may be possible to write an XSLT rule which will strip these duplicates - or it's possible that it will just fail to run because the XML is invalid.

@jbaicoianu
Copy link
Owner Author

Unfortunately our hands are mostly tied on this since we use the browser's built-in XML parsing functionality. I've since added some parsing feedback when XML errors prevent the page from loading, but short of embedding our own XML parsing library, I think we can just live with the fact that malformed XML isn't supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant