File: cr-glib-simple-xml-parser.texi

package info (click to toggle)
g-golf 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,108 kB
  • sloc: lisp: 23,960; sh: 1,213; ansic: 964; makefile: 469; xml: 7
file content (64 lines) | stat: -rw-r--r-- 2,056 bytes parent folder | download | duplicates (2)
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
@c -*-texinfo-*-
@c This is part of the GNU G-Golf Reference Manual.
@c Copyright (C) 2024 Free Software Foundation, Inc.
@c See the file g-golf.texi for copying conditions.


@c @defindex tl


@node Simple XML Subset Parser
@subsection Simple XML Subset Parser

G-Golf GLib Simple XML Subset Parser low level API.@*
Simple XML Subset Parser — parses a subset of XML


@subheading Procedures

@indentedblock
@table @code
@item @ref{g-markup-escape-text}
@end table
@end indentedblock


@subheading Description

The @samp{GMarkup} parser is intended to parse a simple markup format
that's a subset of XML. This is a small, efficient, easy-to-use
parser. It should not be used if you expect to interoperate with other
applications generating full-scale XML. However, it's very useful for
application data files, config files, etc. where you know your
application will be the only one writing the file. Full-scale XML
parsers should be able to parse the subset used by GMarkup, so you can
easily migrate to full-scale XML at a later time if the need arises.

GMarkup is not guaranteed to signal an error on all invalid XML; the
parser may accept documents that an XML parser would not. However, XML
documents which are not well-formed are not considered valid GMarkup
documents.

Please read the @uref{@value{UGLIB-Markup}, Simple XML Subset Parser}
section from the GLib reference manual for a complete description.


@subheading Procedures


@anchor{g-markup-escape-text}
@deffn Procedure g-markup-escape-text text

Returns a string.

Escapes @var{text}, some valid UTF-8 text, so that the markup parser
will parse it verbatim. Less than, greater than, ampersand, etc. are
replaced with the corresponding entities. This function would typically
be used when writing out a file to be parsed with the markup parser.

Note that this function doesn't protect whitespace and line endings from
being processed according to the XML rules for normalization of line
endings and attribute values.

Returns a newly allocated string with the escaped text.
@end deffn