summaryrefslogtreecommitdiff
path: root/lib/TUWF/XML.pod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/TUWF/XML.pod')
-rw-r--r--lib/TUWF/XML.pod14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/TUWF/XML.pod b/lib/TUWF/XML.pod
index e56a89e..1d1fafb 100644
--- a/lib/TUWF/XML.pod
+++ b/lib/TUWF/XML.pod
@@ -110,6 +110,20 @@ the control on where to (not) insert whitespace. Default: 0 (disabled).
=back
+=head2 xml_string(%options, &func)
+
+Convenience function to construct an XML string using the functional interface
+without affecting an existing globally set I<default> object. The I<default>
+object will be set to a newly constructed TUWF::XML object only for the
+duration of C<&func>. The given C<%options> are the same as listed for
+C<new()>, though only the I<pretty> option makes sense for this function.
+Example:
+
+ my $str = xml_string sub {
+ b class => 'hello', 'Hello!';
+ };
+ # $str is '<b class="hello">Hello!</b>'
+
=head2 mkclass(%classes)
Dynamically constructs a I<class> attribute, which can be passed to C<tag()>