| 1 |
<?xml version="1.0" ?> |
| 2 |
<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" |
| 3 |
"dtd/kdedbx45.dtd" [ |
| 4 |
<!ENTITY % addindex "IGNORE"> |
| 5 |
<!ENTITY % English "INCLUDE" > <!-- change language only here --> |
| 6 |
]> |
| 7 |
|
| 8 |
<article lang="&language;" id="data"> |
| 9 |
<title>Data URLs</title> |
| 10 |
|
| 11 |
<articleinfo> |
| 12 |
<authorgroup> |
| 13 |
<author><personname><firstname>Leo</firstname><surname>Savernik</surname></personname> |
| 14 |
<address><email>[email protected]</email></address> |
| 15 |
</author> |
| 16 |
<!-- TRANS:ROLES_OF_TRANSLATORS --> |
| 17 |
</authorgroup> |
| 18 |
|
| 19 |
<date>2003-02-06</date> |
| 20 |
<!--releaseinfo>2.20.00</releaseinfo--> |
| 21 |
|
| 22 |
</articleinfo> |
| 23 |
|
| 24 |
<para>Data URLs allow small document data to be included in the URL itself. |
| 25 |
This is useful for very small HTML testcases or other occasions that do not |
| 26 |
justify a document of their own.</para> |
| 27 |
|
| 28 |
<para><userinput>data:,foobar</userinput> |
| 29 |
(note the comma after the colon) will deliver a text document that contains |
| 30 |
nothing but <literal>foobar</literal> |
| 31 |
</para> |
| 32 |
|
| 33 |
<para>The last example delivered a text document. For HTML documents one |
| 34 |
has to specify the MIME type <literal>text/html</literal>: |
| 35 |
<userinput>data:text/html,<title>Testcase</title><p>This |
| 36 |
is a testcase</p></userinput>. This will produce exactly the same |
| 37 |
output as if the content had been loaded from a document of its own. |
| 38 |
</para> |
| 39 |
|
| 40 |
<para>Specifying alternate character sets is also possible. Note that 8-Bit |
| 41 |
characters have to be escaped by a percentage sign and their two-digit |
| 42 |
hexadecimal codes: |
| 43 |
<userinput>data:;charset=iso-8859-1,Gr%FC%DFe aus Schl%E4gl</userinput> |
| 44 |
results in |
| 45 |
<literal>Grüße aus Schlägl</literal> |
| 46 |
whereas omitting the charset attribute might lead to something like |
| 47 |
<literal>Gr??e aus Schl?gl</literal> |
| 48 |
</para> |
| 49 |
|
| 50 |
<para><ulink url="http://www.ietf.org/rfc/rfc2397.txt">IETF |
| 51 |
RFC2397</ulink> provides more information.</para> |
| 52 |
|
| 53 |
</article> |
| 54 |
|