upgraded to the XML/XSLT toolchain for the HTML generation fixing #111799
[platform/upstream/libxslt.git] / doc / html / libxslt-pattern.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>pattern</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
3         .synopsis, .classsynopsis {
4             background: #eeeeee;
5             border: solid 1px #aaaaaa;
6             padding: 0.5em;
7         }
8         .programlisting {
9             background: #eeeeff;
10             border: solid 1px #aaaaff;
11             padding: 0.5em;
12         }
13         .variablelist {
14             padding: 4px;
15             margin-left: 3em;
16         }
17         .navigation {
18             background: #ffeeee;
19             border: solid 1px #ffaaaa;
20             margin-top: 0.5em;
21             margin-bottom: 0.5em;
22         }
23         .navigation a {
24             color: #770000;
25         }
26         .navigation a:visited {
27             color: #550000;
28         }
29         .navigation .title {
30             font-size: 200%;
31         }
32       </style><link rel="home" href="index.html" title="Gnome XSLT Library Reference Manual"><link rel="up" href="libxslt-lib.html" title="Libxslt Library Reference"><link rel="previous" href="libxslt-functions.html" title="functions"><link rel="next" href="libxslt-templates.html" title="templates"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxslt-functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxslt-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XSLT Library Reference Manual</th><td><a accesskey="n" href="libxslt-templates.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxslt-pattern"></a><div class="titlepage"></div><div class="refnamediv"><h2>pattern</h2><p>pattern &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
33
34
35
36 struct      <a href="libxslt-pattern.html#xsltCompMatch">xsltCompMatch</a>;
37 typedef     <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a>;
38 <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> <a href="libxslt-pattern.html#xsltCompilePattern">xsltCompilePattern</a>         (const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
39                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
40                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
41                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
42                                              <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);
43 void        <a href="libxslt-pattern.html#xsltFreeCompMatchList">xsltFreeCompMatchList</a>           (<a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
44 int         <a href="libxslt-pattern.html#xsltTestCompMatchList">xsltTestCompMatchList</a>           (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
45                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
46                                              <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
47 int         <a href="libxslt-pattern.html#xsltAddTemplate">xsltAddTemplate</a>                 (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
48                                              <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
49                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
50                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);
51 <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> <a href="libxslt-pattern.html#xsltGetTemplate">xsltGetTemplate</a>             (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
52                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
53                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
54 void        <a href="libxslt-pattern.html#xsltFreeTemplateHashes">xsltFreeTemplateHashes</a>          (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
55 void        <a href="libxslt-pattern.html#xsltCleanupTemplates">xsltCleanupTemplates</a>            (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
56 int         <a href="libxslt-pattern.html#xsltMatchPattern">xsltMatchPattern</a>                (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
57                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
58                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
59                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
60                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);
61 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
62
63 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xsltCompMatch"></a>struct xsltCompMatch</h3><pre class="programlisting">struct xsltCompMatch;</pre><p>
64 Data structure used for the implementation of patterns.
65 It is kept private (in pattern.c).</p><p>
66
67 </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltCompMatchPtr"></a>xsltCompMatchPtr</h3><pre class="programlisting">typedef xsltCompMatch *xsltCompMatchPtr;
68 </pre><p>
69
70 </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltCompilePattern"></a>xsltCompilePattern ()</h3><pre class="programlisting"><a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> xsltCompilePattern         (const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
71                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
72                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
73                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
74                                              <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);</pre><p>
75 Compile the XSLT pattern and generates a list of precompiled form suitable
76 for fast matching.
77 </p><p>
78 [1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern</p><p>
79
80 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>pattern</tt></i> :</span></td><td> an XSLT pattern
81 </td></tr><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td>  the containing document
82 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the containing element
83 </td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the stylesheet
84 </td></tr><tr><td><span class="term"><i><tt>runtime</tt></i> :</span></td><td>  the transformation context, if done at run-time
85 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the generated pattern list or NULL in case of failure
86 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltFreeCompMatchList"></a>xsltFreeCompMatchList ()</h3><pre class="programlisting">void        xsltFreeCompMatchList           (<a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);</pre><p>
87 Free up the memory allocated by all the elements of <i><tt>comp</tt></i></p><p>
88
89 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td>  an XSLT comp list
90 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltTestCompMatchList"></a>xsltTestCompMatchList ()</h3><pre class="programlisting">int         xsltTestCompMatchList           (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
91                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
92                                              <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);</pre><p>
93 Test wether the node matches one of the patterns in the list</p><p>
94
95 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td>  a XSLT process context
96 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td> a node
97 </td></tr><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td> the precompiled pattern list
98 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if it matches, 0 if it doesn't and -1 in case of failure
99 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltAddTemplate"></a>xsltAddTemplate ()</h3><pre class="programlisting">int         xsltAddTemplate                 (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
100                                              <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
101                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
102                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);</pre><p>
103 Register the XSLT pattern associated to <i><tt>cur</tt></i></p><p>
104
105 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td> an XSLT stylesheet
106 </td></tr><tr><td><span class="term"><i><tt>cur</tt></i> :</span></td><td> an XSLT template
107 </td></tr><tr><td><span class="term"><i><tt>mode</tt></i> :</span></td><td>  the mode name or NULL
108 </td></tr><tr><td><span class="term"><i><tt>modeURI</tt></i> :</span></td><td>  the mode URI or NULL
109 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise
110 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltGetTemplate"></a>xsltGetTemplate ()</h3><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> xsltGetTemplate             (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
111                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
112                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);</pre><p>
113 Finds the template applying to this node, if <i><tt>style</tt></i> is non-NULL
114 it means one needs to look for the next imported template in scope.</p><p>
115
116 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td>  a XSLT process context
117 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the node being processed
118 </td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the current style
119 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xsltTemplatePtr or NULL if not found
120 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltFreeTemplateHashes"></a>xsltFreeTemplateHashes ()</h3><pre class="programlisting">void        xsltFreeTemplateHashes          (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);</pre><p>
121 Free up the memory used by xsltAddTemplate/xsltGetTemplate mechanism</p><p>
122
123 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td> an XSLT stylesheet
124 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltCleanupTemplates"></a>xsltCleanupTemplates ()</h3><pre class="programlisting">void        xsltCleanupTemplates            (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);</pre><p>
125 Cleanup the state of the templates used by the stylesheet and
126 the ones it imports.</p><p>
127
128 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td> an XSLT stylesheet
129 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xsltMatchPattern"></a>xsltMatchPattern ()</h3><pre class="programlisting">int         xsltMatchPattern                (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
130                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
131                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
132                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
133                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);</pre><p>
134
135 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td>
136 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>
137 </td></tr><tr><td><span class="term"><i><tt>pattern</tt></i> :</span></td><td>
138 </td></tr><tr><td><span class="term"><i><tt>ctxtdoc</tt></i> :</span></td><td>
139 </td></tr><tr><td><span class="term"><i><tt>ctxtnode</tt></i> :</span></td><td>
140 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
141
142
143 </td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxslt-functions.html"><b>&lt;&lt; functions</b></a></td><td align="right"><a accesskey="n" href="libxslt-templates.html"><b>templates &gt;&gt;</b></a></td></tr></table></body></html>