/*
- * Copyright (C) 2005-2008 QSDN,Inc. All rights reserved.
+ * Copyright (C) 2005-2009 QSDN,Inc. All rights reserved.
* Copyright (C) 2005 Atsushi Konno All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
},
{
.type = CHXJ_SPEC_Chtml_4_0,
- .handler = chtml30_handler,
+ .handler = chtml40_handler,
},
{
.type = CHXJ_SPEC_Chtml_5_0,
- .handler = chtml30_handler,
+ .handler = chtml50_handler,
},
{
.type = CHXJ_SPEC_Chtml_6_0,
- .handler = chtml30_handler,
+ .handler = ixhtml10_handler,
},
{
.type = CHXJ_SPEC_Chtml_7_0,
- .handler = chtml30_handler,
+ .handler = ixhtml10_handler,
},
{
.type = CHXJ_SPEC_XHtml_Mobile_1_0,
},
{
.type = CHXJ_SPEC_Jxhtml,
- .handler = jhtml_handler,
+ .handler = jxhtml_handler,
},
{
.type = CHXJ_SPEC_HTML,
if (handlers[tagPLAINTEXT].end_tag_handler)
handlers[tagPLAINTEXT].end_tag_handler(pdoc, child);
}
+ /*----------------------------------------------------------------------*/
+ /* <PARAM> */
+ /*----------------------------------------------------------------------*/
+ else if (strcasecmp(name, "param") == 0) {
+ 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);
}
if (handlers[tagLABEL].end_tag_handler)
handlers[tagLABEL].end_tag_handler(pdoc, child);
}
+ else
+ /*----------------------------------------------------------------------*/
+ /* <LINK> */
+ /*----------------------------------------------------------------------*/
+ if (strcasecmp(name, "link") == 0) {
+ if (handlers[tagLINK].start_tag_handler)
+ handlers[tagLINK].start_tag_handler(pdoc, child);
+
+ chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+ if (handlers[tagLINK].end_tag_handler)
+ handlers[tagLINK].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);
case 'c':
case 'C':
/*----------------------------------------------------------------------*/
+ /* NL (CrLf) */
+ /*----------------------------------------------------------------------*/
+ if (strcasecmp(name, QS_PARSE_NL_MARK) == 0) {
+ if (handlers[tagNLMARK].start_tag_handler)
+ handlers[tagNLMARK].start_tag_handler(pdoc, child);
+ }
+ else
+ /*----------------------------------------------------------------------*/
/* <CENTER> */
/*----------------------------------------------------------------------*/
if (strcasecmp(name, "center") == 0) {
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> */
/*----------------------------------------------------------------------*/
if (chxj_chxjif_is_mine(spec, doc, child)) {
char* parse_attr;
- parse_attr = qs_get_parse_attr(doc, child, r);
+ parse_attr = qs_get_parse_attr(doc, child, r->pool);
if (parse_attr && strcasecmp(parse_attr, "true") == 0) {
chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
}
}
}
+ /*----------------------------------------------------------------------*/
+ /* <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
*/