From de3821ee45fec851c06143e68321d5020ff0556e Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Tue, 8 Feb 2022 15:20:52 +0800 Subject: [PATCH] Signed-off-by: shikai-123 modify bug of xml --- convertxml/js_convertxml.cpp | 2 +- xml/js_xml.cpp | 2 +- xml/js_xml.h | 2 +- xml/native_module_xml.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/convertxml/js_convertxml.cpp b/convertxml/js_convertxml.cpp index 8600210..49313d1 100755 --- a/convertxml/js_convertxml.cpp +++ b/convertxml/js_convertxml.cpp @@ -377,7 +377,7 @@ namespace OHOS::Xml { void ConvertXml::DealIgnore(const napi_value napiObj) { std::vector vctIgnore = {"compact", "trim", "ignoreDeclaration", "ignoreInstruction", - "ignoreAttributes", "ignoreComment", "ignoreCdata", + "ignoreAttributes", "ignoreComment", "ignoreCDATA", "ignoreDoctype", "ignoreText"}; size_t vctLength = vctIgnore.size(); for (size_t i = 0; i < vctLength; ++i) { diff --git a/xml/js_xml.cpp b/xml/js_xml.cpp index 5ab0d84..c592881 100644 --- a/xml/js_xml.cpp +++ b/xml/js_xml.cpp @@ -239,7 +239,7 @@ namespace OHOS::xml { } } } - void XmlSerializer::SetCommnet(std::string comment) + void XmlSerializer::SetComment(std::string comment) { out_ = ""; if (type == "isStart" || type == "isAttri") { diff --git a/xml/js_xml.h b/xml/js_xml.h index ac592eb..70ece5e 100644 --- a/xml/js_xml.h +++ b/xml/js_xml.h @@ -36,7 +36,7 @@ namespace OHOS::xml { void StartElement(std::string name); void EndElement(); void SetNamespace(std::string prefix, std::string nsTemp); - void SetCommnet(std::string comment); + void SetComment(std::string comment); void SetCData(std::string data); void SetText(std::string text); void SetDocType(std::string text); diff --git a/xml/native_module_xml.cpp b/xml/native_module_xml.cpp index 0eb0537..d51aa62 100644 --- a/xml/native_module_xml.cpp +++ b/xml/native_module_xml.cpp @@ -245,7 +245,7 @@ namespace OHOS::xml { return result; } - static napi_value SetCommnet(napi_env env, napi_callback_info info) + static napi_value SetComment(napi_env env, napi_callback_info info) { napi_value thisVar = nullptr; size_t argc = 0; @@ -261,7 +261,7 @@ namespace OHOS::xml { NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&object))); std::string comment; object->DealNapiStrValue(env, args[0], comment); - object->SetCommnet(comment); + object->SetComment(comment); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); return result; @@ -356,8 +356,8 @@ namespace OHOS::xml { DECLARE_NAPI_FUNCTION("startElement", StartElement), DECLARE_NAPI_FUNCTION("endElement", EndElement), DECLARE_NAPI_FUNCTION("setNamespace", SetNamespace), - DECLARE_NAPI_FUNCTION("setCommnet", SetCommnet), - DECLARE_NAPI_FUNCTION("setCData", SetCData), + DECLARE_NAPI_FUNCTION("setComment", SetComment), + DECLARE_NAPI_FUNCTION("setCDATA", SetCData), DECLARE_NAPI_FUNCTION("setText", SetText), DECLARE_NAPI_FUNCTION("setDocType", SetDocType), DECLARE_NAPI_FUNCTION("XmlSerializerError", XmlSerializerError)