1Config::Generator::XML(U3s)er Contributed Perl DocumentatCioonnfig::Generator::XML(3)
2
3
4
6 Config::Generator::XML - Config::Generator XML support
7
9 This module eases XML content generation by providing several functions
10 to generate XML abstractions (xml_blank(), xml_comment(),
11 xml_element(), xml_parse() and xml_wrap()) and one function to convert
12 these abstractions into strings (xml_string()).
13
14 Note: only a subset of XML is supported. This means that this module is
15 not suited for HTML generation.
16
18 This module provides the following functions (none of them being
19 exported by default):
20
21 xml_blank()
22 return an XML abstraction representing a blank line
23
24 xml_comment(STRING)
25 return an XML abstraction representing a comment
26
27 xml_element(NAME[, ATTR[, BODY]])
28 return an XML abstraction representing an element:
29
30 • ATTR: defines the attributes as a hash or array reference
31
32 • BODY: defines the body as a string or list of XML abstractions
33
34 xml_parse(STRING)
35 parse the given string (that must contain well formed XML) and
36 return the list of XML abstractions it contains
37
38 xml_string(ELEMENT[, OPTIONS])
39 return the string representation of the given XML abstraction;
40 supported options:
41
42 • "indent": how many spaces to prepend to each line (default: 0)
43
44 • "line": maximum line length (longer lines will be wrapped)
45
46 • "sort": which elements to have their attributes sorted
47 differently, as a hash: name => sorting function
48
49 • "split": which elements to split (i.e. to have their attributes
50 split on different lines), as a hash: name => boolean
51
52 xml_wrap(NAMES, ELEMENTS)
53 wrap the given XML elements into nested elements of the given names
54 (with no attributes)
55
57 Lionel Cons <http://cern.ch/lionel.cons>
58
59 Copyright (C) CERN 2013-2016
60
61
62
63perl v5.36.0 2022-07-22 Config::Generator::XML(3)