Skip to content

Commit 6e39d1d

Browse files
committed
right output
1 parent 71ca60e commit 6e39d1d

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

ext/dom/php_dom.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,8 @@ static void dom_libxml_reconcile_ensure_namespaces_are_declared(xmlNodePtr nodep
14741474
/* Put on stack to avoid allocation.
14751475
* Although libxml2 currently does not use this for the reconciliation, it still
14761476
* makes sense to do this just in case libxml2's internal change in the future. */
1477-
//xmlDOMWrapCtxt dummy_ctxt = {0};
1478-
//xmlDOMWrapReconcileNamespaces(&dummy_ctxt, nodep, /* options */ 0);
1479-
xmlReconciliateNs(nodep->doc, nodep);
1477+
xmlDOMWrapCtxt dummy_ctxt = {0};
1478+
xmlDOMWrapReconcileNamespaces(&dummy_ctxt, nodep, /* options */ 0);
14801479
}
14811480

14821481
void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) /* {{{ */

ext/dom/tests/bug47530.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,18 @@ test_appendChild_with_shadowing();
118118
--EXPECT--
119119
-- Test document fragment with import --
120120
<?xml version="1.0"?>
121-
<html xmlns="https://php.net/something" xmlns:ns="https://php.net/whatever"><default:element xmlns:default="https://php.net/something" ns:foo="https://php.net/bar"/></html>
121+
<html xmlns="https://php.net/something" xmlns:ns="https://php.net/whatever"><element ns:foo="https://php.net/bar"/></html>
122122
-- Test document fragment without import --
123123
<?xml version="1.0"?>
124-
<html xmlns=""><element xmlns:foo="https://php.net/bar"><foo:bar/><bar/></element></html>
124+
<html xmlns=""><element xmlns:foo="https://php.net/bar"><foo:bar/><bar xmlns=""/></element></html>
125125
string(7) "foo:bar"
126126
string(19) "https://php.net/bar"
127127
-- Test document import --
128128
<?xml version="1.0"?>
129-
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:default="http://www.w3.org/1999/xhtml">
130-
<default:div xmlns="http://www.w3.org/1999/xhtml">
131-
<default:p>Test-Text</default:p>
132-
</default:div>
129+
<feed xmlns="http://www.w3.org/2005/Atom">
130+
<div xmlns="http://www.w3.org/1999/xhtml">
131+
<p>Test-Text</p>
132+
</div>
133133
</feed>
134134
-- Test partial document import --
135135
<?xml version="1.0"?>

ext/dom/tests/bug47847.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ echo $aDOM->saveXML();
2222
?>
2323
--EXPECT--
2424
<?xml version="1.0"?>
25-
<inner xmlns="http://php.net" xmlns:ns="http://php.net">
26-
<WATCH-MY-NAMESPACE xmlns=""/>
27-
</inner>
25+
<ns:inner xmlns="http://php.net" xmlns:ns="http://php.net">
26+
<ns:WATCH-MY-NAMESPACE xmlns=""/>
27+
</ns:inner>

ext/dom/tests/bug55294.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ echo $bDOM->saveXML(), "\n";
2424
?>
2525
--EXPECT--
2626
<?xml version="1.0"?>
27-
<B xmlns="http://example.com/A" xmlns:default="http://example.com/C">
28-
<default:C xmlns="http://example.com/C" xmlns:default="http://example.com/Z"/>
27+
<B xmlns="http://example.com/A">
28+
<C xmlns="http://example.com/C" xmlns:default="http://example.com/Z"/>
2929
</B>

0 commit comments

Comments
 (0)