/* <PARAM> */
/*----------------------------------------------------------------------*/
else if (strcasecmp(name, "param") == 0) {
- /* ignore param tag block. */
+ if (handlers[tagPARAM].start_tag_handler)
+ handlers[tagPARAM].start_tag_handler(pdoc, child);
+
+ chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+ if (handlers[tagPARAM].end_tag_handler)
+ handlers[tagPARAM].end_tag_handler(pdoc, child);
}
else {
chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
/* <OBJECT> */
/*----------------------------------------------------------------------*/
if (strcasecmp(name, "object") == 0) {
- /* ignore object block */
+ if (handlers[tagOBJECT].start_tag_handler)
+ handlers[tagOBJECT].start_tag_handler(pdoc, child);
+
+ chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+ if (handlers[tagOBJECT].end_tag_handler)
+ handlers[tagOBJECT].end_tag_handler(pdoc, child);
}
else {
chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
if (handlers[tagCENTER].end_tag_handler)
handlers[tagCENTER].end_tag_handler(pdoc, child);
}
+ else
+ /*----------------------------------------------------------------------*/
+ /* <CAPTION> */
+ /*----------------------------------------------------------------------*/
+ if (strcasecmp(name, "caption") == 0) {
+ if (handlers[tagCAPTION].start_tag_handler)
+ handlers[tagCAPTION].start_tag_handler(pdoc, child);
+
+ chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+ if (handlers[tagCAPTION].end_tag_handler)
+ handlers[tagCAPTION].end_tag_handler(pdoc, child);
+ }
/*----------------------------------------------------------------------*/
/* <CHXJ:IF> */
/*----------------------------------------------------------------------*/
}
}
}
+ /*----------------------------------------------------------------------*/
+ /* <CHXJ:RAW> */
+ /*----------------------------------------------------------------------*/
+ else
+ if (strcasecmp(name, "chxj:raw") == 0) {
+ if (handlers[tagCHXJRAW].start_tag_handler) {
+ handlers[tagCHXJRAW].start_tag_handler(pdoc, child);
+ }
+ }
else {
chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
}
return NULL;
}
+
+
+char *
+chxj_node_convert_chxjif_only(
+ request_rec *r,
+ device_table *spec,
+ const char *src,
+ apr_size_t *len
+)
+{
+ Doc doc;
+ char *dst;
+ int pass = 0;
+ apr_size_t dst_pos = 0;
+ apr_size_t ii;
+
+ memset(&doc, 0, sizeof(Doc));
+
+ apr_pool_create(&doc.pool, r->pool);
+ doc.r = r;
+
+ dst = apr_palloc(doc.pool, *len + 1);
+ memset(dst, 0, *len + 1);
+
+ for (ii =0; ii<*len; ii++) {
+ if (src[ii + 0] == '<') {
+ apr_size_t endpoint = chxj_cut_tag(&src[ii + 0], *len - ii);
+ Node *node = qs_parse_tag(&doc, &src[ii], endpoint);
+ char *name = qs_get_node_name(&doc,node);
+ if (STRCASEEQ('c','C',"chxj:if", name)) {
+ if (! chxj_chxjif_is_mine(spec, &doc, node)) {
+ pass = 1;
+ }
+ ii += endpoint;
+ }
+ else if (STRCASEEQ('/','/', "/chxj:if", name)) {
+ pass = 0;
+ ii += endpoint;
+ }
+ else {
+ if (! pass) {
+#if 0
+ memcpy(&dst[dst_pos], &src[ii], endpoint + 1);
+ dst_pos += (endpoint + 1);
+#else
+ dst[dst_pos++] = src[ii];
+#endif
+ }
+#if 0
+ ii += endpoint;
+#endif
+ }
+ }
+ else {
+ if (! pass) {
+ if (is_sjis_kanji(src[ii])) {
+ dst[dst_pos++] = src[ii++];
+ dst[dst_pos++] = src[ii];
+ }
+ else {
+ dst[dst_pos++] = src[ii];
+ }
+ }
+ }
+ }
+ *len = strlen(dst);
+ return dst;
+}
/*
* vim:ts=2 et
*/