Skip to content

Commit 35e08ff

Browse files
committed
fixes #19
Added the possibility to add the base node for xml export
1 parent c7b90cc commit 35e08ff

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/SoapBox/Formatter/Formatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function toYaml() {
7171
return $this->parser->toYaml();
7272
}
7373

74-
public function toXml() {
75-
return $this->parser->toXml();
74+
public function toXml($baseNode = 'xml') {
75+
return $this->parser->toXml($baseNode);
7676
}
7777

7878
public function toCsv() {

src/SoapBox/Formatter/Parsers/Parser.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ private function xmlify($data, $structure = null, $basenode = 'xml') {
106106
/**
107107
* Return an xml representation of the data stored in the parser
108108
*
109+
* @param string $baseNode
110+
*
109111
* @return string An xml string representing the encapsulated data
110112
*/
111-
public function toXml() {
112-
return $this->xmlify($this->toArray());
113+
public function toXml($baseNode = 'xml') {
114+
return $this->xmlify($this->toArray(), null, $baseNode);
113115
}
114116

115117
private function csvify($data) {

0 commit comments

Comments
 (0)