static char *s_jxhtml_start_object_tag (void *pdoc, Node *node);
static char *s_jxhtml_end_object_tag (void *pdoc, Node *node);
static char *s_jxhtml_start_param_tag (void *pdoc, Node *node);
+static char *s_jxhtml_start_caption_tag (void *pdoc, Node *node);
+static char *s_jxhtml_end_caption_tag (void *pdoc, Node *node);
static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
s_jxhtml_start_param_tag,
NULL,
},
+ /* tagCAPTION */
+ {
+ s_jxhtml_start_caption_tag,
+ s_jxhtml_end_caption_tag,
+ },
};
jxhtml.entryp = entryp;
jxhtml.cookie = cookie;
-
+ if (strcasecmp(spec->output_encoding,"UTF-8") == 0 ){
+ apr_table_setn(r->headers_out,HTTP_X_CHXJ_SET_CONTENT_TYPE,"application/xhtml+xml; charset=UTF-8");
+ }
chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
/*--------------------------------------------------------------------------*/
r = doc->r;
DBG(r, "REQ[%X] start s_jxhtml_start_html_tag()", TO_ADDR(r));
- W_L("<?xml version=\"1.0\" encoding=\"Shift_JIS\" ?>");
+ W_L("<?xml version=\"1.0\" encoding=\"");
+ W_V(jxhtml->spec->output_encoding);
+ W_L("\" ?>");
W_NLCODE();
W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"xhtml-basic10-plus.dtd\">");
W_NLCODE();
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
W_L(">");
if (IS_CSS_ON(jxhtml->entryp)) {
- s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
}
return jxhtml->out;
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
return jxhtml->out;
}
+static char *
+s_jxhtml_istyle_to_wap_input_format(apr_pool_t *p, const char *s)
+{
+ if (s) {
+ switch (s[0]) {
+ case '1': return apr_psprintf(p, ""*<ja:h>"");
+ case '2': return apr_psprintf(p, ""*<ja:hk>"");
+ case '3': return apr_psprintf(p, ""*<ja:en>"");
+ case '4': return apr_psprintf(p, ""*<ja:n>"");
+ default:
+ return apr_pstrdup(p, "");
+ }
+ }
+
+ return apr_pstrdup(p,"");
+}
+
/**
* It is a handler who processes the INPUT tag.
W_L(" istyle=\"");
W_V(attr_istyle);
W_L("\"");
+
+ char *vv = s_jxhtml_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
+ W_L(" style=\"");
+ W_L("-wrap-input-format:");
+ W_V(vv);
+ W_L(";");
+ W_L("\"");
}
else if(attr_type && STRCASEEQ('p','P',"password",attr_type)) {
W_L(" istyle=\"4\"");
+
+ char *vv = s_jxhtml_istyle_to_wap_input_format(doc->buf.pool,"4");
+ W_L(" style=\"");
+ W_L("-wrap-input-format:");
+ W_V(vv);
+ W_L(";");
+ W_L("\"");
}
/*--------------------------------------------------------------------------*/
/* The figure is default for the password. */
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
css_property_t *cur;
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
char *style_float = NULL;
char *style_border_color = NULL;
+ char *css_clear = NULL;
jxhtml = GET_JXHTML(pdoc);
doc = jxhtml->doc;
css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
css_property_t *border_color_prop = chxj_css_get_property_value(doc, style, "border-color");
+ css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
css_property_t *cur;
for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
}
}
for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
- char *tmp = apr_pstrdup(doc->pool, cur->value);
- char *tmpp = strstr(tmp, "px");
- if (tmpp) {
- attr_size = apr_pstrdup(doc->pool, tmp);
- }
+ attr_size = apr_pstrdup(doc->pool, cur->value);
}
if(!attr_color){
for(cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next){
style_border_color = apr_pstrdup(doc->pool, tmp);
}
}
+ for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+ css_clear = apr_pstrdup(doc->pool, cur->value);
+ }
}
}
W_L("<hr");
W_L("\"");
}
}
- if (attr_size || attr_width || attr_noshade || style_border_color) {
+ if (attr_size || attr_width || attr_noshade || style_border_color || css_clear) {
W_L(" style=\"");
if (attr_size) {
W_L("height:");
W_V(attr_size);
- if (!strstr(attr_size, "px")) {
+ if (chxj_chk_numeric(attr_size) == 0) {
W_L("px");
}
W_L(";");
W_V(style_border_color);
W_V(";");
}
+ if (css_clear){
+ W_L("clear:");
+ W_V(css_clear);
+ W_L(";");
+ }
W_L("\"");
}
if (attr_color) {
char *attr_src = NULL;
char *attr_height = NULL;
char *attr_width = NULL;
- char *attr_align = NULL;
char *attr_alt = NULL;
char *attr_style = NULL;
char *attr_hspace = NULL;
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
attr_src = value;
#endif
}
W_L(">");
if (IS_CSS_ON(jxhtml->entryp)) {
- s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
}
return jxhtml->out;
W_L(">");
if (IS_CSS_ON(jxhtml->entryp)) {
- s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
}
return jxhtml->out;
W_L(" istyle=\"");
W_V(attr_istyle);
W_L("\"");
+
+ char *vv = s_jxhtml_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
+ W_L(" style=\"");
+ W_L("-wap-input-format:");
+ W_V(vv);
+ W_L(";");
+ W_L("\"");
+
}
W_L(">");
return jxhtml->out;
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
}
}
if (IS_CSS_ON(jxhtml->entryp)) {
- css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+ css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
if (style) {
css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
Doc *doc = jxhtml->doc;
Attr *attr;
- char *attr_style = NULL;
char *attr_name = NULL;
char *attr_value = NULL;
char *attr_valuetype = NULL;
W_L(" />");
return jxhtml->out;
}
+/**
+ * It is a handler who processes the CAPTION tag.
+ *
+ * @param pdoc [i/o] The pointer to the JXHTML structure at the output
+ * destination is specified.
+ * @param node [i] The CAPTION tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jxhtml_start_caption_tag(void *pdoc, Node *node)
+{
+ jxhtml_t *jxhtml;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
+ char *attr_style = NULL;
+ char *attr_align = NULL;
+
+ jxhtml = GET_JXHTML(pdoc);
+ doc = jxhtml->doc;
+ r = doc->r;
+
+ for (attr = qs_get_attr(doc,node);
+ attr;
+ attr = qs_get_next_attr(doc,attr)) {
+ char *name = qs_get_attr_name(doc,attr);
+ char *value = qs_get_attr_value(doc,attr);
+ if (STRCASEEQ('a','A',"align", name)) {
+ if (value &&
+ (STRCASEEQ('l','L',"left",value)
+ || STRCASEEQ('r','R',"right",value)
+ || STRCASEEQ('t','T',"top",value)
+ || STRCASEEQ('b','B',"bottom",value)
+ )) {
+ attr_align = value;
+ }
+ }
+ else if (STRCASEEQ('s','S',"style",name) && value && *value) {
+ attr_style = value;
+ }
+ }
+
+ W_L("<caption");
+ if(attr_align){
+ W_L(" align=\"");
+ W_V(attr_align);
+ W_L("\"");
+ }
+ W_L(">");
+
+ return jxhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the CAPTION tag.
+ *
+ * @param pdoc [i/o] The pointer to the JXHTML structure at the output
+ * destination is specified.
+ * @param node [i] The CAPTION tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jxhtml_end_caption_tag(void *pdoc, Node *UNUSED(child))
+{
+ jxhtml_t* jxhtml = GET_JXHTML(pdoc);
+ Doc* doc = jxhtml->doc;
+
+ W_L("</caption>");
+
+ return jxhtml->out;
+}
+
+
/*
* vim:ts=2 et
*/