-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
encoding/xml: XML namespace prefixes not fully supported #6800
Comments
And https://bitbucket.org/anacrolix/dms/issue/25/get-soap-responses-to-work-with-upnp. Perhaps this will help explain the shortcomings here. |
The lack of good support for namespace prefixes does seem to be affecting us here too hooklift/gowsdl#17 |
As I commented on #9519 can we get the ability for xml.Marshal to use prefixes? |
Can we verify that it will in fact work with an XML Namespace aspect like (note the various XMLNS prefixes “stix:, indicator:, cybox:”): <stix:STIX_Package xsi:schemaLocation="
/stix:STIX_Package Thanks,
|
I'm sorry, I don't quite understand what you mean when you ask whether "it will in fact work with an XML Namespace aspect like ...". |
Given the XML example, can your patch parse it correctly and then re-marshall it back in to the same thing? I just want to make sure that it works with all of the namespace prefixes. Thanks SO MUCH for the patch and for fixing this issue. Thanks,
|
There are no xmlns attributes in the fragment you presented. That looks On Mon, Mar 2, 2015 at 2:33 PM, jordan2175 notifications@github.com wrote:
|
Here is an example with them.
|
I'm sorry, github ate your upload. Can you put it in a file an attach or On Mon, Mar 2, 2015 at 2:58 PM, jordan2175 notifications@github.com wrote:
|
I see that. I edited the post above to fix it. I also copied it to pastebin,here |
Here is the example from their website as well. http://stix.mitre.org/about/example_watchlist.html http://stix.mitre.org/about/example_watchlist.html Thanks,
|
@rogpeppe, did this fix land in Go 1.4.x? |
@rogpeppe, I'm having problems marshaling, when attempting to consume a webservice that is expecting namespaces declared at the top along with prefixes, and each inner element using the prefix as opposed to the actual namespace attribute. You can find more details about this issue here: hooklift/gowsdl#17 |
@c4milo This fix is not in go 1.4.1 |
Here is another example that the current XML bindings can not process.. It is a bit different than the current issues, I think, or maybe it is related. If I take out all but one of the xmlns attributes, then it works.
|
I am trying to parse (small snippet):
but I get: error: expected element type <w:document> but have I could change
to
but that breaks everything else. |
@wookoouk this fix is going to land in Go 1.5. So, we are going to still see this failing in Go 1.4.x |
Is it available in HEAD? |
@wookoouk yes, master branch, aka tip, should have it. |
Cheers @c4milo |
I found that the master did not make much difference, I used another package https://github.com/jteeuwen/go-pkg-xmlx to read the xml, correct the name space, and output the xml |
To everyone that is writing the code / patches and everyone that is contributing examples of things that are not working, THANKS!!!! What a great community. Lets make Golang the best! |
yep, sadly the same for me: go version devel +6ffed30 Wed Mar 18 15:14:37 2015 +0000 darwin/amd64
[xmd] go run xmd.go tomd test.docx 16:58:32 ☁ master ☂ ✖ ⚡ ✭
word/document.xml
error: expected element type <w:document> but have <document>% |
This issue should be re-opened then. |
Please open a new issue if necessary. The above additional information confuses the issue whether the applied fix generates a new issue (breaks existing code and we should revert the fix) or just not fixing undiscovered, already reported issues. If you are saying that the applied change 2660 should be reverted for some reason, please write on this issue so. Running issue filters with "encoding/xml in:title" still reports there're 19 open issues. |
I do not believe this issue has actually been fixed with patch 2660. Especially when you consider the fact that issues #9519 and #9775 were closed and folded in to this issue and neither one of them has been addressed. That means until they are also fixed, this issue is not done and should be reopened. |
by anthonyeden:
The text was updated successfully, but these errors were encountered: