1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
|
<?xml version="1.0" encoding="iso-8859-2"?>
<reference id="ref.xslt">
<title>XSLT funkce</title>
<titleabbrev>XSLT</titleabbrev>
<partintro>
&warn.experimental;
<sect1 id="xslt.partintro">
<title>vod</title>
<sect2 id="xslt.intro">
<title>O XSLT and Sablotronu</title>
<para>
XSLT (Extensible Stylesheet Language (XSL) Transformations) je jazyk pro
transformaci XML dokument do jinch XML dokument. Je to standard
definovan The World Wide Web konsorciem (W3C). Imformace o XSLT a
souvisejcch technologich jsou dostupn na
<ulink url="&url.xslt;">&url.xslt;</ulink>.
</para>
</sect2>
<sect2 id="xslt.install">
<title>Instalace</title>
<para>
Tato extenze vyuv <productname>Sabloton</productname> a
<productname>expat</productname>, kter jsou dostupn na <ulink
url="&url.sablotron;">&url.sablotron;</ulink>, a to jak binrn soubory
tak zdrojov kdy.
</para>
<para>
Na UNIXu spuste <command>configure</command> s <option
role="configure">--with-sablot</option>.
<productname>Sablotron</productname> knihovna by mla bt nainstalovna
na njakm mst, kde ji v kompiltor me najt.
</para>
</sect2>
<sect2 id="xslt.about">
<title>O tto extenzi</title>
<para>
Tato PHP extenze implementuje podporu <productname>Sablotron</productname>
od Ginger Alliance v PHP. Tato nstroj vm umouje transformovat XML
dokumenty na jin dokumenty, vetn novch XML dokument, ale tak do XML
a jinch clovch formt. V podstat poskytuje standardizovan a penosn
systm ablon oddlujc obsah a design websajty.
</para>
</sect2>
</sect1>
</partintro>
<refentry id="function.xslt-closelog">
<refnamediv>
<refname>xslt_closelog</refname>
<refpurpose>Smazat log dan instance Sablotronu</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_closelog</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
<variablelist>
<varlistentry>
<term><parameter>xh</parameter></term>
<listitem>
<simpara>
Reference na XSLT parser.
</simpara>
</listitem>
</varlistentry>
</variablelist></para>
<para>
Pokud <parameter>parser</parameter>
neodkazuje na platn parser, nebo pokud zaven logu sele, vrac
&false;, jinak vrac &true;
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-create">
<refnamediv>
<refname>xslt_create</refname>
<refpurpose>Vytvoit nov XSL procesor</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>resource</type><methodname>xslt_create</methodname>
<void/>
</methodsynopsis>
<para>
Tato funkce vrac handle novho XSL procesoru. Tento handle je poteba ve
vech nslednch volnch XSL funkc.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-errno">
<refnamediv>
<refname>xslt_errno</refname>
<refpurpose>Vrtit slo souasn chyby</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>int</type><methodname>xslt_errno</methodname>
<methodparam choice="opt"><type></type><parameter>int xh</parameter></methodparam>
</methodsynopsis>
<para>
Vrac slo souasn chyby danho XSL procesoru. Pokud nedostane handle,
vrac slo posledn chyby bez ohledu na jej vskyt.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-error">
<refnamediv>
<refname>xslt_error</refname>
<refpurpose>Vrtit text posledn chyby</refpurpose>
</refnamediv> <refsect1>
<title>Popis</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_error</methodname>
<methodparam choice="opt"><type>int</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Vrac text souasn chyby danho XSL procesoru. Pokud nedostane handle, vrac
text posledn chyby bez ohledu na jej vskyt.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-fetch-result">
<refnamediv>
<refname>xslt_fetch_result</refname>
<refpurpose>Zskat (pojmenovan) vstupn buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>string</type><methodname>xslt_fetch_result</methodname>
<methodparam><type>int</type><parameter>xh</parameter></methodparam>
<methodparam choice="opt"><type></type><parameter>string result_name</parameter></methodparam>
</methodsynopsis>
<para>
Vrac vstupn buffer XSLT procesoru identifikovanho pedanm handle.
Pokud nedostane jmno vstupnho bufferu, vrac buffer pojmenovan
"/_result".
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-free">
<refnamediv>
<refname>xslt_free</refname>
<refpurpose>Uvolnit XSLT procesor</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>void</type><methodname>xslt_free</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Uvoln XSLT procesor identifikovan pedanm handle.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-openlog">
<refnamediv>
<refname>xslt_openlog</refname>
<refpurpose>Urit log pro zprvy XSLT procesoru</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_openlog</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>logfile</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>loglevel</parameter></methodparam>
</methodsynopsis>
<para>
Ur log soubor, do kterho m XSLT procesor umisovat vechny chybov
zprvy.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-output-begintransform">
<refnamediv>
<refname>xslt_output_begintransform</refname>
<refpurpose>Zat XSLT transformaci vstupu</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>void</type><methodname>xslt_output_begintransform</methodname>
<methodparam><type>string</type><parameter>xslt_filename</parameter></methodparam>
</methodsynopsis>
<para>
Tato funkce zane vstupn transformaci vaich dat. Od okamiku, kdy
zavolte <function>xslt_output_begintransform</function> a do chvle kdy
zavolte <function>xslt_output_endtransform</function> bude vechen vstup
transformovn XSLT stylesheetem udanm v prvnm argumentu.
</para>
<para>
<example>
<title>
Transformace vstupu XSLT stylesheetem pomoc DOM-XML funkc pro
generovn XML
</title>
<programlisting role="php">
<?php
$xsl_file = "article.xsl";
xslt_output_begintransform($xsl_file);
$doc = new_xmldoc('1.0');
$article = $doc->new_root('article');
$article->new_child('title', 'The History of South Tyrol');
$article->new_child('author', 'Sterling Hughes');
$article->new_child('body', 'Back after WWI, Italy gained South Tyrol from
Austria. Since that point nothing interesting has
happened');
echo $doc->dumpmem();
xslt_output_endtransform();
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-output-endtransform">
<refnamediv>
<refname>xslt_output_endtransform</refname>
<refpurpose>Ukonit vstupn transformaci zaatou pomoc xslt_output_begintransform</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>void</type><methodname>xslt_output_endtransform</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_output_endtransform</function> ukon vstupn transformaci
zaatou funkc <function>xslt_output_begintransform</function>. Pokud chcete
vidt vsledky vstupn transformace, muste tuto funkci zavolat.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-process">
<refnamediv>
<refname>xslt_process</refname>
<refpurpose>Transformovat XML data etzcem obsahujcm XSL data</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_process</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>xml</parameter></methodparam>
<methodparam><type>string</type><parameter>xsl</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>arguments</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>parameters</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_process</function> pijm jako prvn argument etzec
obsahujc XSLT stylesheet, jako druh argument etzec obsahujc XML data,
kter chcete transformovat, a jako tet argument etzec obsahujcc
vsledky transformace.
<function>xslt_process</function> vrac &true; pi spchu
a &false; pi selhn. slo a text chyby ppadn vznikl
pi transformaci mete zskat pomoc <function>xslt_errno</function> a
<function>xslt_error</function> funkc.
</para>
<para>
<example>
<title>
Pouit <function>xslt_process</function> k transformaci t etzc
</title>
<programlisting role="php">
<?php
$xslData = '
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="article">
<table border="1" cellpadding="2" cellspacing="1">
<tr>
<td width="20%">
</title>
<td width="80%">
<h2><xsl:value-of select="title"></h2>
<h3><xsl:value-of select="author"></h3>
<br>
<xsl:value-of select="body">
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>';
$xmlData = '
<?xml version="1.0"?>
<article>
<title>Learning German</title>
<author>Sterling Hughes</author>
<body>
Essential phrases:
<br>
<br>
Komme sie mir sagen, woe die toilette es?<br>
Eine grande beer bitte!<br>
Noch einem bitte.<br>
</body>
</article>';
if (xslt_process($xslData, $xmlData, $result))
{
echo "Here is the brilliant in-depth article on learning";
echo " German: ";
echo "<br>\n<br>";
echo $result;
}
else
{
echo "There was an error that occurred in the XSL transformace...\n";
echo "\tError number: " . xslt_errno() . "\n";
echo "\tError string: " . xslt_error() . "\n";
exit;
}
?>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-run">
<refnamediv>
<refname>xslt_run</refname>
<refpurpose>Aplikovat na soubor XSLT stylesheet</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_run</methodname>
<methodparam><parameter>resource xh</parameter></methodparam>
<methodparam><parameter>string xslt_file</parameter></methodparam>
<methodparam><parameter>string xml_data_file</parameter></methodparam>
<methodparam choice="opt"><parameter>string result</parameter></methodparam>
<methodparam choice="opt"><parameter>array xslt_params</parameter></methodparam>
<methodparam choice="opt"><parameter>array xslt_args</parameter></methodparam>
</methodsynopsis>
<para>
Zpracuje
Zpracovat <parameter>string xml_data_file</parameter> aplikac
<parameter>string xslt_file</parameter> stylesheetu.
Tento stylesheet m pstup ke <parameter>xslt_params</parameter> a
nastartuje se procesor s <parameter>xslt_args</parameter>. Vsledek XSLT
transformace se umst do pojmenovanho bufferu
(defaultn "/_result").
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-set-sax-handler">
<refnamediv>
<refname>xslt_set_sax_handler</refname>
<refpurpose>Urit SAX handlery XSLT procesoru</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_set_sax_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
Urit SAX handlery pro handle uren v <parameter>xh</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-transform">
<refnamediv>
<refname>xslt_transform</refname>
<refpurpose>Provst XSLT transformaci</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_transform</methodname>
<methodparam><parameter>string xsl</parameter></methodparam>
<methodparam><parameter>string xml</parameter></methodparam>
<methodparam><parameter>string result</parameter></methodparam>
<methodparam><parameter>string params</parameter></methodparam>
<methodparam><parameter>string args</parameter></methodparam>
<methodparam><parameter>string resultBuffer</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_transform</function> poskytuje interface k pokroilejm
vlastnostem Sablotronu bez nutnosti pout resource API.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|