Tagging mod-proxy-html (3.0.1-1)
[manu/mod-proxy-html.git] / faq.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html lang="en"><head>
4 <title>mod_proxy_html</title>
5 <style type="text/css">
6 @import url(/index.css) ;
7 </style>
8 </head><body>
9 <div id="apache">
10 <h1>mod_proxy_html: Frequently Asked Questions</h1>
11 <p>This answers some of the most frequently asked questions
12 that aren't dealt with (or that people overlook) in the documentation
13 and the apachetutor tutorial.  <span class="v3">This was written for
14 Version 2, and most of the questions are moot in Version 3.</span></p>
15 <h2>Questions</h2>
16 <ol>
17 <li><a href="#charset">Can mod_proxy_html support (charset XYZ) as input?</a></li>
18 <li><a href="#iconv">Can mod_proxy_html support (charset XYZ) as output?</a></li>
19 <li><a href="#script">Why does mod_proxy_html mangle my Javascript?</a></li>
20 <li><a href="#attr">Why doesn't mod_proxy_html rewrite urls in [some attribute]?</a></li>
21 </ol>
22 <h2>Answers</h2>
23 <dl>
24 <dt id="charset">Can mod_proxy_html support (charset XYZ) as input?</dt>
25 <dd><p>That depends entirely on libxml2.  mod_proxy_html supports
26 charset detection, but does not itself support any charsets.
27 It works by passing the charset detected to libxml2 when it sets
28 up the parser.</p>
29 <p>This means that mod_proxy_html inherits its charset support
30 from libxml2, and will always support <em>exactly</em> the same
31 charsets available in the version of libxml2 you have installed.
32 So bug the libxml2 folks, not us!</p>
33 <p class="v3">In Version 3, charset support is much expanded provided
34 <code>ProxyHTMLMeta</code> is enabled, and any charset can be supported
35 by aliasing it with <code>ProxyHTMLCharsetAlias</code>.</p>
36 </dd>
37 <dt id="iconv">Can mod_proxy_html support (charset XYZ) as output?</dt>
38 <dd><p>libxml2 uses <code>utf-8</code> internally for everything.
39 Generating output with another charset is therefore an additional
40 overhead, and the decision was taken to exclude any such capability
41 from mod_proxy_html.  There is an easy workaround: you can transcode
42 the output using another filter, such as mod_charset_lite.</p>
43 <p class="v3">Version 3 supports output transformation to other
44 charsets using <code>ProxyHTMLCharsetOut</code>.</p>
45 </dd>
46 <dt id="script">Why does mod_proxy_html mangle my Javascript?</dt>
47 <dd><p>It doesn't.  Your javascript is simply too badly malformed,
48 and libxml2's error correction isn't what you expect!
49 Check it with <a href="http://valet.webthing.com/page/">a validator</a>,
50 or with libxml2's <tt>xmllint --html</tt>
51 (which uses the same parser as mod_proxy_html).  Here is
52 <a href="/mod_publisher/parser.html">a fuller explanation</a>.</p>
53 <p>The best fix for this is to remove the javascript from your markup,
54 and import it from a separate <tt>.js</tt> file.  If you have an
55 irredeemably broken publishing system, you may have to upgrade to
56 <a href="/mod_publisher/">mod_publisher</a> or resort to the
57 non-markup-aware <a href="/mod_line_edit/">mod_line_edit</a>.</p>
58 </dd>
59 <dt id="attr">Why doesn't mod_proxy_html rewrite urls in [some attribute]?</dt>
60 <dd><p>mod_proxy_html is based on W3C HTML 4.01 and XHTML 1.0 (which are
61 identical in terms of elements and attributes).  It supports all links
62 defined in W3C HTML, even those that have been deprecated since 1997.
63 But it does <strong>NOT</strong> support proprietary pseudo-HTML "extensions"
64 that have never been part of <strong>any</strong> published HTML standard.
65 Of course, it's trivial to add them to the source.</p>
66 <p>This has been the most commonly requested feature since mod_proxy_html 2.0
67 was released in 2004.  It cannot reasonably be satisfied, because everyone's
68 pet "extensions" are different.  <span class="v3">Version 3 deals with this
69 by taking all HTML knowledge out of the code and loading it from httpd.conf
70 instead, so admins can meet their own needs without recompiling.</span></p>
71 </dd>
72 </dl>
73 </div>
74 </body></html>