Lines Matching refs:strXml
301 napi_value ConvertXml::Convert(napi_env env, std::string strXml)
309 size_t len = strXml.size();
310 xmlDocPtr doc = xmlParseMemory(strXml.c_str(), len);
313 DealSingleLine(env, strXml, object);
326 if (!options_.ignoreDeclaration && strXml.find("xml") != std::string::npos) {
488 void ConvertXml::DealSingleLine(napi_env env, std::string &strXml, const napi_value &object)
491 if ((iXml = strXml.find("xml")) != std::string::npos) {
498 if (strXml.find("version=") != std::string::npos) {
503 if (strXml.find("encoding=") != std::string::npos) {
514 if (strXml.find(">", iXml) == strXml.size() - 1) {
515 strXml = "";
517 strXml = strXml.substr(0, strXml.rfind("<", iXml)) + strXml.substr(strXml.find(">", iXml) + 1);
521 size_t iLen = strXml.size();
523 if (strXml[iCount] != ' ' && strXml[iCount] != '\v' &&
524 strXml[iCount] != '\t' && strXml[iCount] != '\n') {
529 DealComplex(env, strXml, object);
533 void ConvertXml::DealComplex(napi_env env, std::string &strXml, const napi_value &object) const
535 if (strXml.find("<!DOCTYPE") != std::string::npos) {
536 strXml = strXml + "<node></node>";
538 strXml = "<node>" + strXml + "</node>";
542 size_t len = strXml.size();
543 doc = xmlParseMemory(strXml.c_str(), static_cast<int>(len));
555 if (strXml.find("<![CDATA") != strXml.rfind("<![CDATA")) {