From 87eac6e5aa71e311d16426c4d496df1f53a6f3b1 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sun, 27 Apr 2014 22:07:35 +0800 Subject: [PATCH] Don't miss entity declarations when generate auto complete prompt --- src/xmlpromptgenerator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xmlpromptgenerator.cpp b/src/xmlpromptgenerator.cpp index 744ef23..25178ad 100644 --- a/src/xmlpromptgenerator.cpp +++ b/src/xmlpromptgenerator.cpp @@ -346,6 +346,14 @@ int XMLCALL XmlPromptGenerator::externalentityrefhandler ( pThis->buildElementPrompt ( d, &curElem, substitutions ); } + NameIdPoolEnumerator + entityEnum = grammar->getEntityEnumerator(); + while ( entityEnum.hasMoreElements() && !pThis->TestDestroy() ) + { + const DTDEntityDecl &entity = entityEnum.nextElement(); + d->entitySet.insert ( WrapXerces::toString ( entity.getName() ) ); + } + return pThis->TestDestroy() ? XML_STATUS_ERROR : XML_STATUS_OK; #else // !PREFER_EXPAT_TO_XERCES_C