1 | <?xml version="1.0"?> |
---|
2 | <!-- |
---|
3 | This stylesheet is not used directly, but rather is processed by |
---|
4 | xmllint with xinclude in order to "insert" the php code from the |
---|
5 | file search.php.inc. |
---|
6 | |
---|
7 | It processes a "generic" documentation page (search.templ) which |
---|
8 | is produced by api.xsl, changes it from xhtml to html (because of |
---|
9 | php limitations), and inserts the php code at the "right spot". |
---|
10 | This "right spot" is a unique element generated by api.xsl with |
---|
11 | the tag name "insert_php". This script replaces that element. |
---|
12 | In order to avoid parsing problems, php code is contained within |
---|
13 | a <xsl:text disable-output-escaping="yes"> node. |
---|
14 | --> |
---|
15 | <xsl:stylesheet version="1.0" |
---|
16 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
17 | xmlns:xhtml="http://www.w3.org/1999/xhtml" |
---|
18 | xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
19 | exclude-result-prefixes="xhtml xi"> |
---|
20 | |
---|
21 | <xsl:output method="xml" omit-xml-declaration="yes" |
---|
22 | doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
23 | doctype-system="http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"/> |
---|
24 | |
---|
25 | <!-- The <html> element is the root for our processing --> |
---|
26 | <xsl:template match="xhtml:html"> |
---|
27 | <html> |
---|
28 | <xsl:apply-templates/> |
---|
29 | </html> |
---|
30 | </xsl:template> |
---|
31 | |
---|
32 | <!-- api.xsl has put a dummy tag at the insert point --> |
---|
33 | <xsl:template match="xhtml:insert_php"> |
---|
34 | <xsl:text disable-output-escaping="yes"> |
---|
35 | <!-- This will be replaced with the php code --> |
---|
36 | <xi:include parse="text" href="search.php.inc"/> |
---|
37 | </xsl:text> |
---|
38 | </xsl:template> |
---|
39 | |
---|
40 | <!-- anything else just gets copied out --> |
---|
41 | <xsl:template match="@*|node()"> |
---|
42 | <xsl:copy> |
---|
43 | <xsl:apply-templates select="@*"/> |
---|
44 | <xsl:apply-templates/> |
---|
45 | </xsl:copy> |
---|
46 | </xsl:template> |
---|
47 | |
---|
48 | </xsl:stylesheet> |
---|