Skip to content

Conversation

valinaga
Copy link

For epub documents which includes these special symbols, exception was raised if not found.
Adding them to entityMap fixed the problem.

@gaggle
Copy link

gaggle commented Nov 5, 2017

I encountered the [xmldom error] entity not found:— error. I've switched to @valinaga's fork and my tests now pass. Thanks @valinaga.

@bigeasy
Copy link
Collaborator

bigeasy commented Nov 5, 2017

They don't belong there. You need to include them.

https://stackoverflow.com/questions/13707500/how-to-include-html-entities-into-an-xml-file

@gaggle
Copy link

gaggle commented Nov 10, 2017

@bigeasy can you elaborate how one "includes them"? I've tried to implement the SO answers but have not gotten it past the mdash.

What I'd like to work is something like this:

const o = {locator: {},errorHandler: (lvl, msg) => {throw new Error(msg)}}
new xmldom.DOMParser(o).parseFromString('<p>&mdash;</p>', 'text/xml')

That fails with:

Error: [xmldom error]	element parse error: Error: [xmldom error]	entity not found:&mdash;

!ENTITY blocks have not helped, e.g.

new xmldom.DOMParser(o).parseFromString('<?xml version="1.0" encoding="utf-8"?> <!ENTITY mdash "&#8212;"> <p>&mdash;</p>', 'text/xml')

Is this the direction you're suggesting as an alternative to this pull request?

(and I didn't mean to steal your thread @valinaga, if this is noise for your problem I can make a new thread)

@bigeasy
Copy link
Collaborator

bigeasy commented Nov 10, 2017

Looking at the code quickly, I don't see that the parser parses ENTITY processing instructions. Will look harder tonight.

@gaggle
Copy link

gaggle commented Nov 23, 2017

@bigeasy did you get a chance to look further into this? I don't mean to imply impatience on my part, I'm happy this project exists at all and that you chose to contribute :), but in the event that you have had time to look into this matter I will happily listen for hints and help on a schedule that suits you, as I have been unable to progress on my own.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants