Moved the man pages to section 3 applied patch from Peter Breitenlohner
[platform/upstream/libxslt.git] / doc / html / libxslt-pattern.html
1 <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">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </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">
32
33
34
35 struct      <a href="libxslt-pattern.html#xsltCompMatch">xsltCompMatch</a>;
36 typedef     <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a>;
37 <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,
38                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
39                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
40                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
41                                              <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);
42 void        <a href="libxslt-pattern.html#xsltFreeCompMatchList">xsltFreeCompMatchList</a>           (<a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
43 int         <a href="libxslt-pattern.html#xsltTestCompMatchList">xsltTestCompMatchList</a>           (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
44                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
45                                              <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
46 int         <a href="libxslt-pattern.html#xsltAddTemplate">xsltAddTemplate</a>                 (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
47                                              <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
48                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
49                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);
50 <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,
51                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
52                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
53 void        <a href="libxslt-pattern.html#xsltFreeTemplateHashes">xsltFreeTemplateHashes</a>          (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
54 void        <a href="libxslt-pattern.html#xsltCleanupTemplates">xsltCleanupTemplates</a>            (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
55 int         <a href="libxslt-pattern.html#xsltMatchPattern">xsltMatchPattern</a>                (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
56                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
57                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
58                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
59                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);
60 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
61
62 </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>
63 Data structure used for the implementation of patterns.
64 It is kept private (in pattern.c).</p><p>
65
66 </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;
67 </pre><p>
68
69 </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,
70                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
71                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
72                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
73                                              <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);</pre><p>
74 Compile the XSLT pattern and generates a list of precompiled form suitable
75 for fast matching.
76 </p><p>
77 [1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern</p><p>
78
79 </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
80 </td></tr><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td>  the containing document
81 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the containing element
82 </td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the stylesheet
83 </td></tr><tr><td><span class="term"><i><tt>runtime</tt></i> :</span></td><td>  the transformation context, if done at run-time
84 </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
85 </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>
86 Free up the memory allocated by all the elements of <i><tt>comp</tt></i></p><p>
87
88 </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
89 </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,
90                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
91                                              <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);</pre><p>
92 Test wether the node matches one of the patterns in the list</p><p>
93
94 </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
95 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td> a node
96 </td></tr><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td> the precompiled pattern list
97 </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
98 </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,
99                                              <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
100                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
101                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);</pre><p>
102 Register the XSLT pattern associated to <i><tt>cur</tt></i></p><p>
103
104 </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
105 </td></tr><tr><td><span class="term"><i><tt>cur</tt></i> :</span></td><td> an XSLT template
106 </td></tr><tr><td><span class="term"><i><tt>mode</tt></i> :</span></td><td>  the mode name or NULL
107 </td></tr><tr><td><span class="term"><i><tt>modeURI</tt></i> :</span></td><td>  the mode URI or NULL
108 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise
109 </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,
110                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
111                                              <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);</pre><p>
112 Finds the template applying to this node, if <i><tt>style</tt></i> is non-NULL
113 it means one needs to look for the next imported template in scope.</p><p>
114
115 </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
116 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the node being processed
117 </td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the current style
118 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xsltTemplatePtr or NULL if not found
119 </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>
120 Free up the memory used by xsltAddTemplate/xsltGetTemplate mechanism</p><p>
121
122 </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
123 </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>
124 Cleanup the state of the templates used by the stylesheet and
125 the ones it imports.</p><p>
126
127 </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
128 </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,
129                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
130                                              const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
131                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
132                                              <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);</pre><p>
133
134 </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>
135 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>
136 </td></tr><tr><td><span class="term"><i><tt>pattern</tt></i> :</span></td><td>
137 </td></tr><tr><td><span class="term"><i><tt>ctxtdoc</tt></i> :</span></td><td>
138 </td></tr><tr><td><span class="term"><i><tt>ctxtnode</tt></i> :</span></td><td>
139 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
140
141
142 </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>