Commit 8b582e8e authored by Leigh B Stoller's avatar Leigh B Stoller

Add optional argument to Serialize; the "format" argument for

toString() that says how to indent the string. Very useful for
printing debugging output. Defaults to 0 (no formating).
parent 887f81aa
......@@ -461,11 +461,12 @@ sub GetText($$)
# Converts the XML representation of a node to a UTF-8 string and
# outputs it as a complete XML document.
sub Serialize($)
sub Serialize($;$)
{
my ($node) = @_;
my ($node, $format) = @_;
$format = 0 if (!defined($format));
my $newnode = $node->cloneNode(1);
return $newnode->toString();
return $newnode->toString($format);
}
# Create a new XML document with a given namespace URI and document
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment