mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
Deal properly with the [dtd] pseudo-entity
Some parsers report the [dtd] pseudo entity through the LexicalHandler. Arabica was incorrectly trying to create an Entity Reference for it.
This commit is contained in:
parent
0c37303b50
commit
2f49994b09
2 changed files with 650 additions and 639 deletions
|
@ -323,6 +323,9 @@ class Parser : protected Arabica::SAX::DefaultHandler<stringT, typename ParserTy
|
||||||
if(--inEntity_ == 0)
|
if(--inEntity_ == 0)
|
||||||
currentNode_ = cachedCurrent_;
|
currentNode_ = cachedCurrent_;
|
||||||
|
|
||||||
|
if(dtd_pseudo_entity == name)
|
||||||
|
return;
|
||||||
|
|
||||||
currentNode_.appendChild(document_.createEntityReference(name));
|
currentNode_.appendChild(document_.createEntityReference(name));
|
||||||
} // endEntity
|
} // endEntity
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,14 @@ public:
|
||||||
* @param text A string holding the comment.
|
* @param text A string holding the comment.
|
||||||
*/
|
*/
|
||||||
virtual void comment(const string_type& text) = 0;
|
virtual void comment(const string_type& text) = 0;
|
||||||
|
|
||||||
|
const string_type dtd_pseudo_entity;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LexicalHandler() :
|
||||||
|
dtd_pseudo_entity(string_adaptor::construct_from_utf8("[dtd]"))
|
||||||
|
{
|
||||||
|
}
|
||||||
}; // class LexicalHandler
|
}; // class LexicalHandler
|
||||||
|
|
||||||
} // namespace SAX
|
} // namespace SAX
|
||||||
|
|
Loading…
Add table
Reference in a new issue