Skip to content

Commit

Permalink
SimpleXML: implement <element attr /> short form in unparse
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Sep 4, 2024
1 parent f47374b commit 0c22b93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Build/SimpleXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ sub unparse {
$r .= " ".unparse_escape($sa);
$r .= '="'.unparse_escape($se->{$sa}).'"' if defined $se->{$sa};
}
if (!@se && !defined($se->{'_content'})) {
$r .= " />$nl";
next;
}
$r .= ">";
$r .= unparse_escape($se->{'_content'}) if defined $se->{'_content'};
$r .= $nl . unparse($se, %opts, 'indent' => " $indent") . "$indent" if @se;
Expand Down

0 comments on commit 0c22b93

Please sign in to comment.