Fix the missing attribute of xmlPullParse parsing result

Fix the xml logical code
issue:https://gitee.com/openharmony/js_api_module/issues/I5FHP8
Signed-off-by: lihucheng <lihucheng1@huawei.com>
This commit is contained in:
lihucheng
2022-07-05 15:05:02 +08:00
parent 3cc8496094
commit 6b4ca9e689
+5 -2
View File
@@ -531,7 +531,9 @@ namespace OHOS::xml {
napi_call_function(env, global, attrFunc_, argc, argv, &returnVal);
bool bRec = false;
napi_get_value_bool(env, returnVal, &bRec);
return bRec;
if (!bRec) {
return bRec;
}
}
return true;
}
@@ -560,6 +562,7 @@ namespace OHOS::xml {
}
if (attrFunc_ && attriCount_) {
bRec = ParseAttri(env, thisVar);
attriCount_ = 0;
}
if (attrFunc_ && attriCount_ && !bRec) {
break;
@@ -898,7 +901,7 @@ namespace OHOS::xml {
bool throwOnResolveFailure, TextEnum textEnum)
{
size_t start = position_;
std::string result = " ";
std::string result = "";
if (textEnum == TextEnum::TEXT && text_ != "") {
result.append(text_);
}