Skip to content

Commit 787fd63

Browse files
authored
XML comments
Add ability to post XML comments via a '@comment' attribute in the array (string only)
1 parent a59c60e commit 787fd63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

LSS/Array2XML.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ private static function &convert($node_name, $arr = array()) {
133133
//return from recursion, as a note with cdata cannot have child nodes.
134134
return $node;
135135
}
136+
else if (isset($arr['@comment']) && is_string($arr['@comment'])) {
137+
$node->appendChild($xml->createComment(self::bool2str($arr['@comment'])));
138+
unset($arr['@comment']);
139+
}
136140
else if (isset($arr['@xml'])) {
137141
$fragment = $xml->createDocumentFragment();
138142
$fragment->appendXML($arr['@xml']);

0 commit comments

Comments
 (0)