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 {
5 border: solid 1px #aaaaaa;
10 border: solid 1px #aaaaff;
19 border: solid 1px #ffaaaa;
26 .navigation a:visited {
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 — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
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>
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>
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;
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
78 [1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern</p><p>
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>
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>
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>
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>
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>
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>
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>
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>
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><< functions</b></a></td><td align="right"><a accesskey="n" href="libxslt-templates.html"><b>templates >></b></a></td></tr></table></body></html>