File: section-feature.xml

package info (click to toggle)
raptor 1.4.13-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,576 kB
  • ctags: 4,494
  • sloc: ansic: 31,845; sh: 9,278; xml: 8,589; yacc: 2,912; lex: 1,018; makefile: 817; perl: 61; cpp: 59
file content (308 lines) | stat: -rw-r--r-- 14,527 bytes parent folder | download
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="raptor-section-feature">
<refmeta>
<refentrytitle role="top_of_page">Features</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>RAPTOR Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Features</refname>
<refpurpose>Parser and Serializer features</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



enum        <link linkend="raptor-feature">raptor_feature</link>;
unsigned <link linkend="int">int</link> <link linkend="raptor-get-feature-count">raptor_get_feature_count</link>       (void);
<link linkend="int">int</link>         <link linkend="raptor-features-enumerate">raptor_features_enumerate</link>       (const <link linkend="raptor-feature">raptor_feature</link> feature,
                                             const <link linkend="char">char</link> **name,
                                             <link linkend="raptor-uri">raptor_uri</link> **uri,
                                             const <link linkend="char">char</link> **label);
<link linkend="raptor-feature">raptor_feature</link> <link linkend="raptor-feature-from-uri">raptor_feature_from_uri</link>      (<link linkend="raptor-uri">raptor_uri</link> *uri);
<link linkend="int">int</link>         <link linkend="raptor-feature-value-type">raptor_feature_value_type</link>       (const <link linkend="raptor-feature">raptor_feature</link> feature);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
Optional parameters for <link linkend="raptor-parser"><type>raptor_parser</type></link> and <link linkend="raptor-serializer"><type>raptor_serializer</type></link>
objects that can be get and set.  Utility functions also exist
to enumerate them, their description and the parameter type
taken.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="raptor-feature" role="enum"/>enum raptor_feature</title>
<indexterm><primary>raptor_feature</primary></indexterm><programlisting>typedef enum {
  RAPTOR_FEATURE_SCANNING,
  RAPTOR_FEATURE_ASSUME_IS_RDF,
  RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES,
  RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES,
  RAPTOR_FEATURE_ALLOW_BAGID,
  RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST,
  RAPTOR_FEATURE_NORMALIZE_LANGUAGE,
  RAPTOR_FEATURE_NON_NFC_FATAL,
  RAPTOR_FEATURE_WARN_OTHER_PARSETYPES,
  RAPTOR_FEATURE_CHECK_RDF_ID,
  RAPTOR_FEATURE_RELATIVE_URIS,
  RAPTOR_FEATURE_START_URI,
  RAPTOR_FEATURE_WRITER_AUTO_INDENT,
  RAPTOR_FEATURE_WRITER_AUTO_EMPTY,
  RAPTOR_FEATURE_WRITER_INDENT_WIDTH,
  RAPTOR_FEATURE_WRITER_XML_VERSION,
  RAPTOR_FEATURE_WRITER_XML_DECLARATION,
  RAPTOR_FEATURE_NO_NET,
  RAPTOR_FEATURE_LAST=RAPTOR_FEATURE_NO_NET
} raptor_feature;
</programlisting>
<para>
Raptor parser, serializer or XML writer features.</para>
<para>

</para><variablelist role="enum">
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-SCANNING:CAPS" role="constant"/><literal>RAPTOR_FEATURE_SCANNING</literal></term>
<listitem><simpara> If true (default false), the RDF/XML
  parser will look for embedded rdf:RDF elements inside the XML
  content, and not require that the XML start with an rdf:RDF root
  element.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-ASSUME-IS-RDF:CAPS" role="constant"/><literal>RAPTOR_FEATURE_ASSUME_IS_RDF</literal></term>
<listitem><simpara> If true (default false) then the
  RDF/XML parser will assume the content is RDF/XML, not require
  that rdf:RDF root element, and immediately interpret the content
  as RDF/XML.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-ALLOW-NON-NS-ATTRIBUTES:CAPS" role="constant"/><literal>RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES</literal></term>
<listitem><simpara> If true (default true)
  then the RDF/XML parser will allow non-XML namespaced attributes
  to be accepted as well as rdf: namespaced ones.  For example,
  'about' and 'ID' will be interpreted as if they were rdf:about
  and rdf:ID respectively.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-ALLOW-OTHER-PARSETYPES:CAPS" role="constant"/><literal>RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES</literal></term>
<listitem><simpara> If true (default true)
  then the RDF/XML parser will allow unknown parsetypes to be
  present and will pass them on to the user.  Unimplemented at
  present.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-ALLOW-BAGID:CAPS" role="constant"/><literal>RAPTOR_FEATURE_ALLOW_BAGID</literal></term>
<listitem><simpara> If true (default true) then the
  RDF/XML parser will support the rdf:bagID attribute that was
  removed from the RDF/XML language when it was revised.  This
  support may be removed in future.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-ALLOW-RDF-TYPE-RDF-LIST:CAPS" role="constant"/><literal>RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST</literal></term>
<listitem><simpara> If true (default false)
  then the RDF/XML parser will generate the idList rdf:type
  rdf:List triple in the handling of rdf:parseType="Collection".
  This triple was removed during the revising of RDF/XML after
  collections were initially added.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-NORMALIZE-LANGUAGE:CAPS" role="constant"/><literal>RAPTOR_FEATURE_NORMALIZE_LANGUAGE</literal></term>
<listitem><simpara> If true (default true) then
  XML language values such as from xml:lang will be normalized to
  lowercase.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-NON-NFC-FATAL:CAPS" role="constant"/><literal>RAPTOR_FEATURE_NON_NFC_FATAL</literal></term>
<listitem><simpara> If true (default false) then
 illegal Unicode Normal Form C in literals will give a fatal
 error, otherwise just a warning.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WARN-OTHER-PARSETYPES:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WARN_OTHER_PARSETYPES</literal></term>
<listitem><simpara> If true (default true) then 
  the RDF/XML parser will warn about unknown rdf:parseType values.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-CHECK-RDF-ID:CAPS" role="constant"/><literal>RAPTOR_FEATURE_CHECK_RDF_ID</literal></term>
<listitem><simpara> If true (default true) then the
  RDF/XML will check rdf:ID attribute values for duplicates and
  cause an error if any are found.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-RELATIVE-URIS:CAPS" role="constant"/><literal>RAPTOR_FEATURE_RELATIVE_URIS</literal></term>
<listitem><simpara> If true (default true) then
  relative URIs will be used wherever possible when serializing.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-START-URI:CAPS" role="constant"/><literal>RAPTOR_FEATURE_START_URI</literal></term>
<listitem><simpara> Set the start URI for serlalizing to use.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WRITER-AUTO-INDENT:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WRITER_AUTO_INDENT</literal></term>
<listitem><simpara> Automatically indent elements when
  seriailizing.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WRITER-AUTO-EMPTY:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WRITER_AUTO_EMPTY</literal></term>
<listitem><simpara> Automatically detect and
  abbreviate empty elements when serializing.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WRITER-INDENT-WIDTH:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WRITER_INDENT_WIDTH</literal></term>
<listitem><simpara> Integer number of spaces to use
  for each indent level when serializing with auto indent.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WRITER-XML-VERSION:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WRITER_XML_VERSION</literal></term>
<listitem><simpara> Integer XML version XML 1.0 (10) or XML 1.1 (11)
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-WRITER-XML-DECLARATION:CAPS" role="constant"/><literal>RAPTOR_FEATURE_WRITER_XML_DECLARATION</literal></term>
<listitem><simpara> Write XML 1.0 or 1.1 declaration.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-NO-NET:CAPS" role="constant"/><literal>RAPTOR_FEATURE_NO_NET</literal></term>
<listitem><simpara> Deny network requests
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="RAPTOR-FEATURE-LAST:CAPS" role="constant"/><literal>RAPTOR_FEATURE_LAST</literal></term>
<listitem><simpara> Internal
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-get-feature-count" role="function"/>raptor_get_feature_count ()</title>
<indexterm><primary>raptor_get_feature_count</primary></indexterm><programlisting>unsigned <link linkend="int">int</link> raptor_get_feature_count       (void);</programlisting>
<para>
Get the count of features defined.
</para>
<para>
This is prefered to the compile time-only symbol <link linkend="RAPTOR-FEATURE-LAST:CAPS"><type>RAPTOR_FEATURE_LAST</type></link>
and returns a count of the number of features which is
<link linkend="RAPTOR-FEATURE-LAST:CAPS"><type>RAPTOR_FEATURE_LAST</type></link>+1.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> count of features in the <link linkend="raptor-feature"><type>raptor_feature</type></link> enumeration
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-features-enumerate" role="function"/>raptor_features_enumerate ()</title>
<indexterm><primary>raptor_features_enumerate</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_features_enumerate       (const <link linkend="raptor-feature">raptor_feature</link> feature,
                                             const <link linkend="char">char</link> **name,
                                             <link linkend="raptor-uri">raptor_uri</link> **uri,
                                             const <link linkend="char">char</link> **label);</programlisting>
<para>
Get list of syntax features.
</para>
<para>
If uri is not NULL, a pointer toa new raptor_uri is returned
that must be freed by the caller with <link linkend="raptor-free-uri"><function>raptor_free_uri()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>feature</parameter>&nbsp;:</term>
<listitem><simpara> feature enumeration (0+)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara> pointer to store feature short name (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> pointer to store feature URI (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>label</parameter>&nbsp;:</term>
<listitem><simpara> pointer to feature label (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> 0 on success, &lt;0 on failure, &gt;0 if feature is unknown
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-feature-from-uri" role="function"/>raptor_feature_from_uri ()</title>
<indexterm><primary>raptor_feature_from_uri</primary></indexterm><programlisting><link linkend="raptor-feature">raptor_feature</link> raptor_feature_from_uri      (<link linkend="raptor-uri">raptor_uri</link> *uri);</programlisting>
<para>
Turn a feature URI into an feature enum.
</para>
<para>
The allowed feature URIs are available via <link linkend="raptor-features-enumerate"><function>raptor_features_enumerate()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> feature URI
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> &lt; 0 if the feature is unknown
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-feature-value-type" role="function"/>raptor_feature_value_type ()</title>
<indexterm><primary>raptor_feature_value_type</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_feature_value_type       (const <link linkend="raptor-feature">raptor_feature</link> feature);</programlisting>
<para>
Get the type of a features.
</para>
<para>
The type of the <parameter>feature</parameter> is 0=integer , 1=string.  Other values are
undefined.  Most features are integer values and use
raptor_set_feature and <link linkend="raptor-get-feature"><function>raptor_get_feature()</function></link>
( raptor_serializer_set_feature <link linkend="raptor-serializer-get-feature"><function>raptor_serializer_get_feature()</function></link> )
</para>
<para>
String value features use <link linkend="raptor-parser-set-feature-string"><function>raptor_parser_set_feature_string()</function></link> and
<link linkend="raptor-parser-get-feature-string"><function>raptor_parser_get_feature_string()</function></link>
( <link linkend="raptor-serializer-set-feature-string"><function>raptor_serializer_set_feature_string()</function></link>
and <link linkend="raptor-serializer-get-feature-string"><function>raptor_serializer_get_feature_string()</function></link> )</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>feature</parameter>&nbsp;:</term>
<listitem><simpara> raptor serializer or parser feature
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the type of the feature or &lt;0 if <parameter>feature</parameter> is unknown
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>