File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ function xmlSerialize(Writer $writer) {
8383 $ writer ->startElement (
8484 $ reader ->getClark ()
8585 );
86+ $ empty = $ reader ->isEmptyElement ;
8687 while ($ reader ->moveToNextAttribute ()) {
8788 switch ($ reader ->namespaceURI ) {
8889 case '' :
@@ -96,7 +97,7 @@ function xmlSerialize(Writer $writer) {
9697 break ;
9798 }
9899 }
99- if ($ reader -> isEmptyElement ) {
100+ if ($ empty ) {
100101 $ writer ->endElement ();
101102 }
102103 break ;
Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ function xmlProvider() {
9898 '<foo:element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns"><child/></foo:element> ' ,
9999 '<x1:element xmlns:x1="http://example.org/ns"><child/></x1:element> ' ,
100100 ],
101+ [
102+ '<foo:element xmlns:foo="http://example.org/ns"><child a="b"/></foo:element> ' ,
103+ '<foo:element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns"><child a="b"/></foo:element> ' ,
104+ '<x1:element xmlns:x1="http://example.org/ns"><child a="b"/></x1:element> ' ,
105+ ],
101106 ];
102107
103108 }
You can’t perform that action at this time.
0 commit comments