当前位置: 首页>>代码示例>>C++>>正文


C++ xmlValidateName函数代码示例

本文整理汇总了C++中xmlValidateName函数的典型用法代码示例。如果您正苦于以下问题:C++ xmlValidateName函数的具体用法?C++ xmlValidateName怎么用?C++ xmlValidateName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xmlValidateName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

/* {{{ proto void DOMAttr::__construct(string name, [string value]) */
PHP_METHOD(domattr, __construct)
{
	zval *id = getThis();
	xmlAttrPtr nodep = NULL;
	xmlNodePtr oldnode = NULL;
	dom_object *intern;
	char *name, *value = NULL;
	size_t name_len, value_len, name_valid;

	if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) {
		return;
	}

	intern = Z_DOMOBJ_P(id);

	name_valid = xmlValidateName((xmlChar *) name, 0);
	if (name_valid != 0) {
		php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
		RETURN_FALSE;
	}

	nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value);

	if (!nodep) {
		php_dom_throw_error(INVALID_STATE_ERR, 1);
		RETURN_FALSE;
	}

	oldnode = dom_object_get_node(intern);
	if (oldnode != NULL) {
		php_libxml_node_free_resource(oldnode );
	}
	php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern);
}
开发者ID:ghfjdksl,项目名称:php-src,代码行数:35,代码来源:attr.c

示例2: INSTANCE_METHOD_INJECTION_BUILTIN

bool c_XMLWriter::t_writeelementns(CStrRef prefix, CStrRef name, CStrRef uri,
                                   CStrRef content /* = null_string */) {
  INSTANCE_METHOD_INJECTION_BUILTIN(XMLWriter, XMLWriter::writeelementns);
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    if (content.isNull()) {
      ret = xmlTextWriterStartElementNS(m_ptr, (xmlChar*)prefix.data(),
                                        (xmlChar*)name.data(),
                                        (xmlChar*)uri.data());
      if (ret == -1) return false;
      ret = xmlTextWriterEndElement(m_ptr);
      if (ret == -1) return false;
    } else {
      ret = xmlTextWriterWriteElementNS(m_ptr, (xmlChar*)prefix.data(),
                                        (xmlChar*)name.data(),
                                        (xmlChar*)uri.data(),
                                        (xmlChar*)content.data());
    }
  }
  return ret != -1;
}
开发者ID:activeingredient,项目名称:hiphop-php,代码行数:25,代码来源:ext_xmlwriter.cpp

示例3: PHP_METHOD

/* {{{ proto void DOMEntityReference::__construct(string name); */
PHP_METHOD(domentityreference, __construct)
{
	zval *id = getThis();
	xmlNode *node;
	xmlNodePtr oldnode = NULL;
	dom_object *intern;
	char *name;
	size_t name_len, name_valid;

	if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
		return;
	}

	name_valid = xmlValidateName((xmlChar *) name, 0);
	if (name_valid != 0) {
		php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
		RETURN_FALSE;
	}

	node = xmlNewReference(NULL, (xmlChar *) name);

	if (!node) {
		php_dom_throw_error(INVALID_STATE_ERR, 1);
		RETURN_FALSE;
	}

	intern = Z_DOMOBJ_P(id);
	if (intern != NULL) {
		oldnode = dom_object_get_node(intern);
		if (oldnode != NULL) {
			php_libxml_node_free_resource(oldnode );
		}
		php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern);
	}
}
开发者ID:0xhacking,项目名称:php-src,代码行数:36,代码来源:entityreference.c

示例4: slaxJsonElementOpen

void
slaxJsonElementOpen (slax_data_t *sdp, const char *name)
{
    int valid = xmlValidateName((const xmlChar *) name, FALSE);
    const char *element = valid ? ELT_ELEMENT : name;

    slaxElementOpen(sdp, element);
    if (element != name)
	slaxAttribAddLiteral(sdp, ATT_NAME, name);
}
开发者ID:aruns16,项目名称:libslax,代码行数:10,代码来源:jsonlexer.c

示例5: t_startpi

bool c_XMLWriter::t_startpi(const String& target) {
  if (xmlValidateName((xmlChar*)target.data(), 0)) {
    raise_warning("invalid PI target: %s", target.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartPI(m_ptr, (xmlChar*)target.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:11,代码来源:ext_xmlwriter.cpp

示例6: t_startattribute

bool c_xmlwriter::t_startattribute(CStrRef name) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid attribute name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartAttribute(m_ptr, (xmlChar*)name.data());
  }
  return ret != -1;
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:11,代码来源:ext_xmlwriter.cpp

示例7: t_startelement

bool c_XMLWriter::t_startelement(CStrRef name) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartElement(m_ptr, (xmlChar*)name.data());
  }
  return ret != -1;
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:11,代码来源:ext_xmlwriter.cpp

示例8: t_startdtdentity

bool c_XMLWriter::t_startdtdentity(const String& name, bool isparam) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid attribute name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartDTDEntity(m_ptr, isparam, (xmlChar*)name.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:11,代码来源:ext_xmlwriter.cpp

示例9: t_startdtdelement

bool c_xmlwriter::t_startdtdelement(CStrRef qualifiedname) {
  if (xmlValidateName((xmlChar*)qualifiedname.data(), 0)) {
    raise_warning("invalid element name: %s", qualifiedname.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartDTDElement(m_ptr, (xmlChar*)qualifiedname.data());
  }
  return ret != -1;
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:11,代码来源:ext_xmlwriter.cpp

示例10: t_startdtdattlist

bool c_XMLWriter::t_startdtdattlist(const String& name) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartDTDAttlist(m_ptr, (xmlChar*)name.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:11,代码来源:ext_xmlwriter.cpp

示例11: t_writeattribute

bool c_XMLWriter::t_writeattribute(const String& name, const String& value) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid attribute name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterWriteAttribute(m_ptr, (xmlChar*)name.data(),
                                      (xmlChar*)value.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:12,代码来源:ext_xmlwriter.cpp

示例12: t_writedtdattlist

bool c_xmlwriter::t_writedtdattlist(CStrRef name, CStrRef content) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterWriteDTDAttlist(m_ptr, (xmlChar*)name.data(),
                                       (xmlChar*)content.data());
  }
  return ret != -1;
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:12,代码来源:ext_xmlwriter.cpp

示例13: t_writedtdelement

bool c_XMLWriter::t_writedtdelement(const String& name, const String& content) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterWriteDTDElement(m_ptr, (xmlChar*)name.data(),
                                       (xmlChar*)content.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:12,代码来源:ext_xmlwriter.cpp

示例14: t_writepi

bool c_xmlwriter::t_writepi(CStrRef target, CStrRef content) {
  if (xmlValidateName((xmlChar*)target.data(), 0)) {
    raise_warning("invalid PI target: %s", target.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterWritePI(m_ptr, (xmlChar*)target.data(),
                               (xmlChar*)content.data());
  }
  return ret != -1;
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:12,代码来源:ext_xmlwriter.cpp

示例15: t_startelementns

bool c_XMLWriter::t_startelementns(const String& prefix, const String& name, const String& uri) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    ret = xmlTextWriterStartElementNS(m_ptr, (xmlChar*)prefix.data(),
                                      (xmlChar*)name.data(),
                                      (xmlChar*)uri.data());
  }
  return ret != -1;
}
开发者ID:chethenry,项目名称:hiphop-php,代码行数:13,代码来源:ext_xmlwriter.cpp


注:本文中的xmlValidateName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。