Lines Matching refs:ctx
35 static zend_result dom_html5_serialize_doctype(dom_html5_serialize_context *ctx, const xmlDtd *dtd) in dom_html5_serialize_doctype() argument
37 TRY(ctx->write_string_len(ctx->application_data, "<!DOCTYPE ", strlen("<!DOCTYPE "))); in dom_html5_serialize_doctype()
38 TRY(ctx->write_string(ctx->application_data, (const char *) dtd->name)); in dom_html5_serialize_doctype()
39 return ctx->write_string_len(ctx->application_data, ">", strlen(">")); in dom_html5_serialize_doctype()
42 static zend_result dom_html5_serialize_comment(dom_html5_serialize_context *ctx, const xmlNode *nod… in dom_html5_serialize_comment() argument
44 TRY(ctx->write_string_len(ctx->application_data, "<!--", strlen("<!--"))); in dom_html5_serialize_comment()
46 TRY(ctx->write_string(ctx->application_data, (const char*) node->content)); in dom_html5_serialize_comment()
48 return ctx->write_string_len(ctx->application_data, "-->", strlen("-->")); in dom_html5_serialize_comment()
51 static zend_result dom_html5_serialize_processing_instruction(dom_html5_serialize_context *ctx, con… in dom_html5_serialize_processing_instruction() argument
53 TRY(ctx->write_string_len(ctx->application_data, "<?", strlen("<?"))); in dom_html5_serialize_processing_instruction()
54 TRY(ctx->write_string(ctx->application_data, (const char *) node->name)); in dom_html5_serialize_processing_instruction()
55 TRY(ctx->write_string_len(ctx->application_data, " ", strlen(" "))); in dom_html5_serialize_processing_instruction()
57 TRY(ctx->write_string(ctx->application_data, (const char *) node->content)); in dom_html5_serialize_processing_instruction()
59 return ctx->write_string_len(ctx->application_data, ">", strlen(">")); in dom_html5_serialize_processing_instruction()
62 static zend_result dom_html5_serialize_entity_ref(dom_html5_serialize_context *ctx, const xmlNode *… in dom_html5_serialize_entity_ref() argument
64 TRY(ctx->write_string_len(ctx->application_data, "&", strlen("&"))); in dom_html5_serialize_entity_ref()
65 TRY(ctx->write_string(ctx->application_data, (const char *) node->name)); in dom_html5_serialize_entity_ref()
66 return ctx->write_string_len(ctx->application_data, ";", strlen(";")); in dom_html5_serialize_entity_ref()
70 static zend_result dom_html5_escape_string(dom_html5_serialize_context *ctx, const char *content, b… in dom_html5_escape_string() argument
88 TRY(ctx->write_string_len(ctx->application_data, last_output, content - last_output)); in dom_html5_escape_string()
89 TRY(ctx->write_string_len(ctx->application_data, "&", strlen("&"))); in dom_html5_escape_string()
97 TRY(ctx->write_string_len(ctx->application_data, last_output, content - last_output)); in dom_html5_escape_string()
98 TRY(ctx->write_string_len(ctx->application_data, " ", strlen(" "))); in dom_html5_escape_string()
107 TRY(ctx->write_string_len(ctx->application_data, last_output, content - last_output)); in dom_html5_escape_string()
108 TRY(ctx->write_string_len(ctx->application_data, """, strlen("""))); in dom_html5_escape_string()
115 TRY(ctx->write_string_len(ctx->application_data, last_output, content - last_output)); in dom_html5_escape_string()
116 TRY(ctx->write_string_len(ctx->application_data, "<", strlen("<"))); in dom_html5_escape_string()
121 TRY(ctx->write_string_len(ctx->application_data, last_output, content - last_output)); in dom_html5_escape_string()
122 TRY(ctx->write_string_len(ctx->application_data, ">", strlen(">"))); in dom_html5_escape_string()
131 return ctx->write_string_len(ctx->application_data, last_output, content - last_output); in dom_html5_escape_string()
134 static zend_result dom_html5_serialize_text_node(dom_html5_serialize_context *ctx, const xmlNode *n… in dom_html5_serialize_text_node() argument
153 return ctx->write_string(ctx->application_data, (const char *) node->content); in dom_html5_serialize_text_node()
157 return dom_html5_escape_string(ctx, (const char *) node->content, false); in dom_html5_serialize_text_node()
160 static zend_result dom_html5_serialize_element_tag_name(dom_html5_serialize_context *ctx, const xml… in dom_html5_serialize_element_tag_name() argument
165 TRY(ctx->write_string(ctx->application_data, (const char *) node->ns->prefix)); in dom_html5_serialize_element_tag_name()
166 TRY(ctx->write_string_len(ctx->application_data, ":", strlen(":"))); in dom_html5_serialize_element_tag_name()
168 return ctx->write_string(ctx->application_data, (const char *) node->name); in dom_html5_serialize_element_tag_name()
171 static zend_result dom_html5_serialize_element_start(dom_html5_serialize_context *ctx, const xmlNod… in dom_html5_serialize_element_start() argument
173 TRY(ctx->write_string_len(ctx->application_data, "<", strlen("<"))); in dom_html5_serialize_element_start()
174 TRY(dom_html5_serialize_element_tag_name(ctx, node)); in dom_html5_serialize_element_start()
179 TRY(ctx->write_string_len(ctx->application_data, " ", strlen(" "))); in dom_html5_serialize_element_start()
181 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
184 TRY(ctx->write_string_len(ctx->application_data, "xml:", strlen("xml:"))); in dom_html5_serialize_element_start()
185 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
189 TRY(ctx->write_string_len(ctx->application_data, "xmlns", strlen("xmlns"))); in dom_html5_serialize_element_start()
191 TRY(ctx->write_string_len(ctx->application_data, "xmlns:", strlen("xmlns:"))); in dom_html5_serialize_element_start()
192 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
195 TRY(ctx->write_string_len(ctx->application_data, "xlink:", strlen("xlink:"))); in dom_html5_serialize_element_start()
196 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
198 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
200 TRY(ctx->write_string(ctx->application_data, (const char *) attr->ns->prefix)); in dom_html5_serialize_element_start()
201 TRY(ctx->write_string_len(ctx->application_data, ":", strlen(":"))); in dom_html5_serialize_element_start()
202 TRY(ctx->write_string(ctx->application_data, (const char *) attr->name)); in dom_html5_serialize_element_start()
206 TRY(ctx->write_string_len(ctx->application_data, "=\"", strlen("=\""))); in dom_html5_serialize_element_start()
211 TRY(dom_html5_escape_string(ctx, (const char *) child->content, true)); in dom_html5_serialize_element_start()
214 TRY(ctx->write_string_len(ctx->application_data, "&", strlen("&"))); in dom_html5_serialize_element_start()
215 TRY(dom_html5_escape_string(ctx, (const char *) child->name, true)); in dom_html5_serialize_element_start()
216 TRY(ctx->write_string_len(ctx->application_data, ";", strlen(";"))); in dom_html5_serialize_element_start()
220 TRY(ctx->write_string_len(ctx->application_data, "\"", strlen("\""))); in dom_html5_serialize_element_start()
223 return ctx->write_string_len(ctx->application_data, ">", strlen(">")); in dom_html5_serialize_element_start()
260 static zend_result dom_html5_serialize_element_end(dom_html5_serialize_context *ctx, const xmlNode … in dom_html5_serialize_element_end() argument
263 TRY(ctx->write_string_len(ctx->application_data, "</", strlen("</"))); in dom_html5_serialize_element_end()
264 TRY(dom_html5_serialize_element_tag_name(ctx, node)); in dom_html5_serialize_element_end()
265 return ctx->write_string_len(ctx->application_data, ">", strlen(">")); in dom_html5_serialize_element_end()
271 static zend_result dom_html5_serialize_node(dom_html5_serialize_context *ctx, const xmlNode *node, … in dom_html5_serialize_node() argument
276 TRY(dom_html5_serialize_doctype(ctx, (const xmlDtd *) node)); in dom_html5_serialize_node()
282 TRY(dom_html5_serialize_text_node(ctx, node)); in dom_html5_serialize_node()
287 TRY(dom_html5_serialize_processing_instruction(ctx, node)); in dom_html5_serialize_node()
292 TRY(dom_html5_serialize_comment(ctx, node)); in dom_html5_serialize_node()
297 TRY(dom_html5_serialize_element_start(ctx, node)); in dom_html5_serialize_node()
300 children = php_dom_retrieve_templated_content(ctx->private_data, node); in dom_html5_serialize_node()
309 TRY(dom_html5_serialize_element_end(ctx, node)); in dom_html5_serialize_node()
324 TRY(dom_html5_serialize_entity_ref(ctx, node)); in dom_html5_serialize_node()
342 TRY(dom_html5_serialize_element_end(ctx, node)); in dom_html5_serialize_node()
353 zend_result dom_html5_serialize(dom_html5_serialize_context *ctx, const xmlNode *node) in dom_html5_serialize() argument
369 xmlNodePtr children = php_dom_retrieve_templated_content(ctx->private_data, node); in dom_html5_serialize()
377 return dom_html5_serialize_node(ctx, children, node); in dom_html5_serialize()
381 zend_result dom_html5_serialize_outer(dom_html5_serialize_context *ctx, const xmlNode *node) in dom_html5_serialize_outer() argument
388 return dom_html5_serialize_node(ctx, node, node->parent); in dom_html5_serialize_outer()
392 zend_result result = dom_html5_serialize_node(ctx, node, node->parent); in dom_html5_serialize_outer()