summaryrefslogtreecommitdiff
path: root/doc/search.xml
blob: 1d499f3e07fca40c46c7581052840f25a5f99f8b (plain)
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
<?xml version="1.0"?>
<!--
  This stylesheet is not used directly, but rather is processed by
  xmllint with xinclude in order to "insert" the php code from the
  file search.php.inc.

  It processes a "generic" documentation page (search.templ) which
  is produced by api.xsl, changes it from xhtml to html (because of
  php limitations), and inserts the php code at the "right spot".
  This "right spot" is a unique element generated by api.xsl with
  the tag name "insert_php".  This script replaces that element.
  In order to avoid parsing problems, php code is contained within
  a <xsl:text disable-output-escaping="yes"> node.
-->
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xi="http://www.w3.org/2003/XInclude"
  exclude-result-prefixes="xhtml xi">

  <xsl:output method="xml" omit-xml-declaration="yes"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
    doctype-system="http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"/>

  <!-- The <html> element is the root for our processing -->
  <xsl:template match="xhtml:html">
    <html>
      <xsl:apply-templates/>
    </html>
  </xsl:template>

  <!-- api.xsl has put a dummy tag at the insert point -->
  <xsl:template match="xhtml:insert_php">
    <xsl:text disable-output-escaping="yes">
<!-- This will be replaced with the php code -->
<xi:include parse="text" href="search.php.inc"/>
    </xsl:text>
  </xsl:template>

  <!-- anything else just gets copied out -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>