-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
w3cDom.asString: Namespace for prefix 'xxx' has not been declared #2087
Comments
I'm not sure what the best way to handle this is. The exception is coming out of the JDKs XML serializer ( A couple of options:
Option 1 is probably more compatible (in that in this instance of Vue, the JS would still execute). Can you add some detail to your use case -- what are you trying to do with using this W3C interface and serialization vs the jsoup document serialization? |
Hi @jhy, I'm using a JavaFX WebView to load web pages, which gives us a W3C document which I then convert into a String using the W3CDom class provided by JSoup. |
Hey @jhy, just wondering if there were any updates on this one? Is there still more info you need? :) |
Sorry for the late reply. Thanks for the usecase info. So, I think my suggested option 1 would be best? Or, do you have another suggestion? |
Hi @jhy, I agree that option 1 would work best! |
I have fixed this for W3C DOM objects created by jsoup - as in your test case. However for W3C DOMs created outside of jsoup (e.g. you mentioned via JavaFX), this won't help. I tried adding an error listener to the transformer, but could not catch it. So will treat that as out of scope for the present. I think you could do a pass on the document and add the missing prefixes before passing to the asString. |
Hi @jhy, Thanks for the update, looks great! |
So basically I noticed this crash when trying to use w3CDom.asString() for a site which was created using Vue.js, and it was using "v-bind" in the place of "xxx"
To reproduce you can run the following test case:
The text was updated successfully, but these errors were encountered: