Skip to content

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

Merged
merged 1 commit into from
Jul 25, 2014
Merged

Added support for encoding and decoding namespaced xml (xmlns) #11375

merged 1 commit into from
Jul 25, 2014

Conversation

ClementGautier
Copy link
Contributor

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

@ClementGautier
Copy link
Contributor Author

@mattvick I've rewritten your commit to use the new implementation, I hope its ok for you.

@mattvick
Copy link
Contributor

@ClementGautier sure thanks

@fabpot
Copy link
Member

fabpot commented Jul 11, 2014

👍


$xpath = new \DOMXPath($dom);
$data = array();
foreach( $xpath->query('namespace::*', $dom->documentElement) as $nsNode ) {
Copy link
Contributor

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) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakzal thanks

@jakzal
Copy link
Contributor

jakzal commented Jul 12, 2014

👍

$data['@'.$nsNode->nodeName] = $nsNode->nodeValue;
}

if (isset($data['@xmlns:xml'])) {
Copy link
Contributor

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

Copy link
Member

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

@fabpot
Copy link
Member

fabpot commented Jul 25, 2014

Thank you @ClementGautier.

@fabpot fabpot merged commit 9d6b20c into symfony:master Jul 25, 2014
fabpot added a commit that referenced this pull request Jul 25, 2014
… (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)
@Tobion
Copy link
Contributor

Tobion commented Feb 17, 2015

This was actually a surprising BC break for us. All these xmlns keys suddenly. This should not have been enabled without feature flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants