-
Notifications
You must be signed in to change notification settings - Fork 408
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
Allow foreign ns elements and attributes in svg content docs #970
Conversation
I reviewed the NVDL script. It looks good to me, but I would like to use a mode name different from "attach". This mode does not attach foreign elements or attributes. |
How about calling it allowForeignNS? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mattgarrish for submitting this PR, and thank you @murata2makoto for the review!
Before merging, I'll need to augment the PR with the Java code to preprocess (remove) data-*
attributes, in both HTML and SVG Content Docs. That's why I'm reviewing as "Request changes".
This code is sitting on a branch in my local working copy btw, I'll push it when I'm back.
Main changes: - switch to a master NVDL schema for SVG Content Document validation (in EPUB 3) - allow elements and attributes in foreign namespaces in SVG Content Documents, except where otherwise forbidden in the spec (i.e. in the `foreignObject` element, where only HTML is allowed) - allow `data-*` attributes in SVG (by removing them at parsing time) - add more tests Also: - slightly refactor the attribute pre-processing in XMLParser Fix #491
f8e79c8
to
ca29c89
Compare
I updated the PR:
I took the opportunity to update Jing to v20181222 (which fixes #859 without us having to provide a hack, and even from an NVDL schema factory). @mattgarrish I couldn't assign you to review your own PR, but if you can have a quick look… 😉 |
LGTM! |
(Resubmitting branched off next/v4.2.0 this time.)
I believe this NVDL accomplishes what is needed for #491. It attaches XHTML elements as well as epub:, xlink: and xml: attributes, as well as attributes in no namespace. Elements and attributes from any other namespace are blanket allowed.
The empty pattern in the sch file is annoying, but without it oxygen was complaining that a required pattern was missing. Seems to be harmless, but feel free to comment it out.