summaryrefslogtreecommitdiff
path: root/doc/html/libxslt-pattern.html
blob: 4d36d63667790fd40c01349c48eccdd0e68c0b39 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<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">
        .synopsis, .classsynopsis {
            background: #eeeeee;
            border: solid 1px #aaaaaa;
            padding: 0.5em;
        }
        .programlisting {
            background: #eeeeff;
            border: solid 1px #aaaaff;
            padding: 0.5em;
        }
        .variablelist {
            padding: 4px;
            margin-left: 3em;
        }
        .navigation {
            background: #ffeeee;
            border: solid 1px #ffaaaa;
            margin-top: 0.5em;
            margin-bottom: 0.5em;
        }
        .navigation a {
            color: #770000;
        }
        .navigation a:visited {
            color: #550000;
        }
        .navigation .title {
            font-size: 200%;
        }
      </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">



struct      <a href="libxslt-pattern.html#xsltCompMatch">xsltCompMatch</a>;
typedef     <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a>;
<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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
                                             <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);
void        <a href="libxslt-pattern.html#xsltFreeCompMatchList">xsltFreeCompMatchList</a>           (<a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
int         <a href="libxslt-pattern.html#xsltTestCompMatchList">xsltTestCompMatchList</a>           (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);
int         <a href="libxslt-pattern.html#xsltAddTemplate">xsltAddTemplate</a>                 (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
                                             <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);
<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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
void        <a href="libxslt-pattern.html#xsltFreeTemplateHashes">xsltFreeTemplateHashes</a>          (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
void        <a href="libxslt-pattern.html#xsltCleanupTemplates">xsltCleanupTemplates</a>            (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);
int         <a href="libxslt-pattern.html#xsltMatchPattern">xsltMatchPattern</a>                (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);
</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>

</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>
Data structure used for the implementation of patterns.
It is kept private (in pattern.c).</p><p>

</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;
</pre><p>

</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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> doc,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style,
                                             <a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> runtime);</pre><p>
Compile the XSLT pattern and generates a list of precompiled form suitable
for fast matching.
</p><p>
[1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern</p><p>

</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
</td></tr><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td>  the containing document
</td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the containing element
</td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the stylesheet
</td></tr><tr><td><span class="term"><i><tt>runtime</tt></i> :</span></td><td>  the transformation context, if done at run-time
</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
</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>
Free up the memory allocated by all the elements of <i><tt>comp</tt></i></p><p>

</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
</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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-pattern.html#xsltCompMatchPtr">xsltCompMatchPtr</a> comp);</pre><p>
Test wether the node matches one of the patterns in the list</p><p>

</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
</td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td> a node
</td></tr><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td> the precompiled pattern list
</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
</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,
                                             <a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> cur,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *mode,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *modeURI);</pre><p>
Register the XSLT pattern associated to <i><tt>cur</tt></i></p><p>

</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
</td></tr><tr><td><span class="term"><i><tt>cur</tt></i> :</span></td><td> an XSLT template
</td></tr><tr><td><span class="term"><i><tt>mode</tt></i> :</span></td><td>  the mode name or NULL
</td></tr><tr><td><span class="term"><i><tt>modeURI</tt></i> :</span></td><td>  the mode URI or NULL
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise
</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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style);</pre><p>
Finds the template applying to this node, if <i><tt>style</tt></i> is non-NULL
it means one needs to look for the next imported template in scope.</p><p>

</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
</td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>  the node being processed
</td></tr><tr><td><span class="term"><i><tt>style</tt></i> :</span></td><td>  the current style
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xsltTemplatePtr or NULL if not found
</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>
Free up the memory used by xsltAddTemplate/xsltGetTemplate mechanism</p><p>

</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
</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>
Cleanup the state of the templates used by the stylesheet and
the ones it imports.</p><p>

</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
</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,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> node,
                                             const <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlChar">xmlChar</GTKDOCLINK> *pattern,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlDocPtr">xmlDocPtr</GTKDOCLINK> ctxtdoc,
                                             <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlNodePtr">xmlNodePtr</GTKDOCLINK> ctxtnode);</pre><p>

</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>
</td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>
</td></tr><tr><td><span class="term"><i><tt>pattern</tt></i> :</span></td><td>
</td></tr><tr><td><span class="term"><i><tt>ctxtdoc</tt></i> :</span></td><td>
</td></tr><tr><td><span class="term"><i><tt>ctxtnode</tt></i> :</span></td><td>
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>


</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>