-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Added support for encoding and decoding namespaced xml (xmlns) #11375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@mattvick I've rewritten your commit to use the new implementation, I hope its ok for you. |
@ClementGautier sure thanks |
👍 |
|
||
$xpath = new \DOMXPath($dom); | ||
$data = array(); | ||
foreach( $xpath->query('namespace::*', $dom->documentElement) as $nsNode ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be foreach ($xpath->query('namespace::*', $dom->documentElement) as $nsNode) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakzal thanks
👍 |
$data['@'.$nsNode->nodeName] = $nsNode->nodeValue; | ||
} | ||
|
||
if (isset($data['@xmlns:xml'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isset
is unnecessary... unset
will work without warning if the key is defined or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed this in 21e7ad7
Thank you @ClementGautier. |
… (xmlns) (mattvick) This PR was merged into the 2.6-dev branch. Discussion ---------- Added support for encoding and decoding namespaced xml (xmlns) Q | A ------------ | ------------- Bug fix? | no New feature? | yes BC breaks? | no Deprecations? | no Tests pass? | yes Fixed tickets | #10625 License | MIT Complete this PR : #9156 Commits ------- 9d6b20c Added support for encoding and decoding namespaced xml (xmlns)
This was actually a surprising BC break for us. All these |
Complete this PR : #9156