예제 #1
0
void xdebug_xml_return_node(xdebug_xml_node* node, struct xdebug_str *output) {
  xdebug_str_addl(output, "<", 1, 0);
  xdebug_str_add(output, node->tag, 0);

  if (node->text && node->text->encode) {
    xdebug_xml_add_attribute_ex(node, "encoding", "base64", 0, 0);
  }
  if (node->attribute) {
    xdebug_xml_return_attribute(node->attribute, output);
  }
  xdebug_str_addl(output, ">", 1, 0);

  if (node->child) {
    xdebug_xml_return_node(node->child, output);
  }

  if (node->text) {
    xdebug_xml_return_text_node(node->text, output);
  }

  xdebug_str_addl(output, "</", 2, 0);
  xdebug_str_add(output, node->tag, 0);
  xdebug_str_addl(output, ">", 1, 0);

  if (node->next) {
    xdebug_xml_return_node(node->next, output);
  }
}
예제 #2
0
파일: xdebug_xml.c 프로젝트: atis/xdebug
static void xdebug_xml_return_attribute(xdebug_xml_attribute* attr, xdebug_str* output)
{
	char *tmp;
	int newlen;

	xdebug_str_addl(output, " ", 1, 0);

	/* attribute name */
	tmp = xdebug_xmlize(attr->name, attr->name_len, &newlen);
	xdebug_str_addl(output, tmp, newlen, 0);
	efree(tmp);

	/* attribute value */
	xdebug_str_addl(output, "=\"", 2, 0);
	if (attr->value) {
		tmp = xdebug_xmlize(attr->value, attr->value_len, &newlen);
		xdebug_str_add(output, tmp, 0);
		efree(tmp);
	}
	xdebug_str_addl(output, "\"", 1, 0);
	
	if (attr->next) {
		xdebug_xml_return_attribute(attr->next, output);
	}
}
예제 #3
0
static void xdebug_xml_return_attribute(xdebug_xml_attribute* attr, xdebug_str* output)
{
	char *tmp;
	int newlen;

	xdebug_str_addl(output, " ", 1, 0);
	xdebug_str_add(output, attr->name, 0);
	xdebug_str_addl(output, "=\"", 2, 0);
	if (attr->value) {
//		tmp = xmlize(attr->value, strlen(attr->value), &newlen);
		xdebug_str_add(output, attr->value, 0);
//		efree(tmp);
	}
	xdebug_str_addl(output, "\"", 1, 0);
	
	if (attr->next) {
		xdebug_xml_return_attribute(attr->next, output);
	}
}
예제 #4
0
static void xdebug_xml_return_attribute(xdebug_xml_attribute* attr,
                                        xdebug_str* output) {
  String tmp;
  xdebug_str_addl(output, " ", 1, 0);

  /* attribute name */
  tmp = xdebug_xmlize(attr->name, attr->name_len);
  xdebug_str_addl(output, tmp.get()->mutableData(), tmp.size(), 0);

  /* attribute value */
  xdebug_str_addl(output, "=\"", 2, 0);
  if (attr->value) {
    tmp = xdebug_xmlize(attr->value, attr->value_len);
    xdebug_str_add(output, tmp.get()->mutableData(), 0);
  }
  xdebug_str_addl(output, "\"", 1, 0);

  if (attr->next) {
    xdebug_xml_return_attribute(attr->next, output);
  }
}