Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 11006

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>XSL functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="函数参考"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="XMLWriter::writeRaw"
HREF="function.xmlwriter-write-raw.html"><LINK
REL="NEXT"
TITLE="XSLTProcessor::__construct"
HREF="function.xsl-xsltprocessor-construct.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.xmlwriter-write-raw.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.xsl-xsltprocessor-construct.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.xsl"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>CLXXXIII. XSL functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN245987"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.intro"
>简介</A
></H1
><P
>&#13;     The XSL extension implements the XSL standard, performing <A
HREF="http://www.w3.org/TR/xslt"
TARGET="_top"
>XSLT transformations</A
> using the <A
HREF="http://xmlsoft.org/XSLT/"
TARGET="_top"
>libxslt library</A
>
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.requirements"
>需求</A
></H1
><P
>&#13;     This extension uses <SPAN
CLASS="productname"
>libxslt</SPAN
> which can be
     found at <A
HREF="http://xmlsoft.org/XSLT/"
TARGET="_top"
>http://xmlsoft.org/XSLT/</A
>. libxslt
     version 1.1.0 or greater is required.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.installation"
>安装</A
></H1
><P
>&#13;   PHP 5 includes the XSL extension by default and can be enabled
   by adding the argument <CODE
CLASS="option"
>--with-xsl[=DIR]</CODE
>
   to your configure line. <TT
CLASS="literal"
>DIR</TT
> is the libxslt installation
   directory.
  </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.classes"
>预定义类</A
></H1
><P
>&#13;    </P
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="xsl.class.xsltprocessor"
><B
CLASS="classname"
>XSLTProcessor</B
></A
></H2
><P
>&#13;      </P
><DIV
CLASS="section"
><H3
CLASS="section"
><A
NAME="xsl.class.xsltprocessor.constructor"
>构造函数</A
></H3
><P
></P
><UL
><LI
><P
><A
HREF="function.xsl-xsltprocessor-construct.html"
>XSLTProcessor::__construct</A
> - construct a new XSLTProcessor object</P
></LI
></UL
></DIV
><DIV
CLASS="section"
><H3
CLASS="section"
><A
NAME="xsl.class.xsltprocessor.methods"
>方法</A
></H3
><P
></P
><UL
><LI
><P
><A
HREF="function.xsl-xsltprocessor-get-parameter.html"
>XSLTProcessor::getParameter</A
> - Get value of a parameter</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-has-exslt-support.html"
>XSLTProcessor::hasExsltSupport</A
> - Determine if PHP has EXSLT support</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-import-stylesheet.html"
>XSLTProcessor::importStylesheet</A
> - Import stylesheet</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-register-php-functions.html"
>XSLTProcessor::registerPHPFunctions</A
> - Enables the ability to use PHP functions as XSLT functions</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-remove-parameter.html"
>XSLTProcessor::removeParameter</A
> - Remove parameter</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-set-parameter.html"
>XSLTProcessor::setParameter</A
> - Set value for a parameter</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-transform-to-doc.html"
>XSLTProcessor::transformToDoc</A
> - Transform to DOMDocument</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-transform-to-uri.html"
>XSLTProcessor::transformToURI</A
> - Transform to URI</P
></LI
><LI
><P
><A
HREF="function.xsl-xsltprocessor-transform-to-xml.html"
>XSLTProcessor::transformToXML</A
> - Transform to XML</P
></LI
></UL
></DIV
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.examples"
>范例</A
></H1
><P
>&#13;     Many examples in this reference require both an XML and an XSL file.
     We will use <TT
CLASS="filename"
>collection.xml</TT
> and 
     <TT
CLASS="filename"
>collection.xsl</TT
> that contains the following:
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN246052"
></A
><P
><B
>例 1. collection.xml</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="xml"
>&#60;collection&#62;
 &#60;cd&#62;
  &#60;title&#62;Fight for your mind&#60;/title&#62;
  &#60;artist&#62;Ben Harper&#60;/artist&#62;
  &#60;year&#62;1995&#60;/year&#62;
 &#60;/cd&#62;
 &#60;cd&#62;
  &#60;title&#62;Electric Ladyland&#60;/title&#62;
  &#60;artist&#62;Jimi Hendrix&#60;/artist&#62;
  &#60;year&#62;1997&#60;/year&#62;
 &#60;/cd&#62;
&#60;/collection&#62;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN246055"
></A
><P
><B
>例 2. collection.xsl</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="xml"
>&#60;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&#62;
 &#60;xsl:param name="owner" select="'Nicolas Eliaszewicz'"/&#62;
 &#60;xsl:output method="html" encoding="iso-8859-1" indent="no"/&#62;
 &#60;xsl:template match="collection"&#62;
  Hey! Welcome to &#60;xsl:value-of select="$owner"/&#62;'s sweet CD collection! 
  &#60;xsl:apply-templates/&#62;
 &#60;/xsl:template&#62;
 &#60;xsl:template match="cd"&#62;
  &#60;h1&#62;&#60;xsl:value-of select="title"/&#62;&#60;/h1&#62;
  &#60;h2&#62;by &#60;xsl:value-of select="artist"/&#62; - &#60;xsl:value-of select="year"/&#62;&#60;/h2&#62;
  &#60;hr /&#62;
 &#60;/xsl:template&#62;
&#60;/xsl:stylesheet&#62;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="xsl.constants"
>预定义常量</A
></H1
><P
>以下常量由本扩展模块定义,因此只有在本扩展模块被编译到
PHP 中,或者在运行时被动态加载后才有效。</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><TT
CLASS="constant"
><B
>XSL_CLONE_AUTO</B
></TT
>
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;    </P
></DD
><DT
><TT
CLASS="constant"
><B
>XSL_CLONE_NEVER</B
></TT
>
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;    </P
></DD
><DT
><TT
CLASS="constant"
><B
>XSL_CLONE_ALWAYS</B
></TT
>
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;    </P
></DD
><DT
><TT
CLASS="constant"
><B
>LIBXSLT_VERSION</B
></TT
>
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     libxslt version like 10117. Available as of PHP 5.1.2.
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>LIBXSLT_DOTTED_VERSION</B
></TT
>
    (<A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
>)</DT
><DD
><P
>&#13;     libxslt version like 1.1.17. Available as of PHP 5.1.2.
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>LIBEXSLT_VERSION</B
></TT
>
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     libexslt version like 813. Available as of PHP 5.1.2.
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>LIBEXSLT_DOTTED_VERSION</B
></TT
>
    (<A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
>)</DT
><DD
><P
>&#13;     libexslt version like 1.1.17. Available as of PHP 5.1.2.
    </P
></DD
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>目录</B
></DT
><DT
><A
HREF="function.xsl-xsltprocessor-construct.html"
>XSLTProcessor::__construct</A
>&nbsp;--&nbsp;Creates a new XSLTProcessor object</DT
><DT
><A
HREF="function.xsl-xsltprocessor-get-parameter.html"
>XSLTProcessor::getParameter</A
>&nbsp;--&nbsp;Get value of a parameter</DT
><DT
><A
HREF="function.xsl-xsltprocessor-has-exslt-support.html"
>XSLTProcessor::hasExsltSupport</A
>&nbsp;--&nbsp;Determine if PHP has EXSLT support</DT
><DT
><A
HREF="function.xsl-xsltprocessor-import-stylesheet.html"
>XSLTProcessor::importStylesheet</A
>&nbsp;--&nbsp;Import stylesheet</DT
><DT
><A
HREF="function.xsl-xsltprocessor-register-php-functions.html"
>XSLTProcessor::registerPHPFunctions</A
>&nbsp;--&nbsp;Enables the ability to use PHP functions as XSLT functions</DT
><DT
><A
HREF="function.xsl-xsltprocessor-remove-parameter.html"
>XSLTProcessor::removeParameter</A
>&nbsp;--&nbsp;Remove parameter</DT
><DT
><A
HREF="function.xsl-xsltprocessor-set-parameter.html"
>XSLTProcessor::setParameter</A
>&nbsp;--&nbsp;Set value for a parameter</DT
><DT
><A
HREF="function.xsl-xsltprocessor-transform-to-doc.html"
>XSLTProcessor::transformToDoc</A
>&nbsp;--&nbsp;Transform to a DOMDocument</DT
><DT
><A
HREF="function.xsl-xsltprocessor-transform-to-uri.html"
>XSLTProcessor::transformToURI</A
>&nbsp;--&nbsp;Transform to URI</DT
><DT
><A
HREF="function.xsl-xsltprocessor-transform-to-xml.html"
>XSLTProcessor::transformToXML</A
>&nbsp;--&nbsp;Transform to XML</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.xmlwriter-write-raw.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.xsl-xsltprocessor-construct.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>XMLWriter::writeRaw</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>XSLTProcessor::__construct</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>