Skip to content
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: add support for xml version 1.1 #25755

Open
cpanato opened this issue Jun 6, 2018 · 16 comments
Open

encoding/xml: add support for xml version 1.1 #25755

cpanato opened this issue Jun 6, 2018 · 16 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@cpanato
Copy link

cpanato commented Jun 6, 2018

What version of Go are you using (go version)?

go 1.10.2

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

GOHOSTARCH="amd64"
GOHOSTOS="darwin"

There are any plans to add support for XML version 1.1 in the "encoding/xml" lib?

thanks!

@ianlancetaylor ianlancetaylor changed the title add suppport on encoding/xml for xml version 1.1 encoding/xml: add support for xml version 1.1 Jun 6, 2018
@ianlancetaylor
Copy link
Contributor

What would be required to make this happen?

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels Jun 6, 2018
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jun 6, 2018
@ianlancetaylor
Copy link
Contributor

@summychou Thanks, noted, but please see https://golang.org/wiki/NoPlusOne . Can you answer the question I asked above?

@runzexia
Copy link

@ianlancetaylor https://www.w3.org/TR/xml11/#sec-xml11
changes in xml 1.1

@runzexia
Copy link

@iris-garcia
Copy link

Is there any alternative to parse a 1.1 XML document?

@ohenak
Copy link

ohenak commented May 4, 2020

Haven't get a change to go through the XML 1.1 spec yet, but the seems to be mainly on extending further Unicode support.

"XML 1.1 improves on some of the short comings of XML 1.0, notably recognizing end of line. There currently exists a misalignment between what XML and Unicode defines as end of line, this affects particularly IBM machines, as well as systems communicating with them .

XML 1.1 also adds 2 new important characters NEL and a line separator. NEL 0x85 is used to mark the end of line and for completeness 0x2028 is used to mark the separation of line, this is extremely helpful in normalizing linefeed in text which plagues XML 1.0."

According to this post:
http://echmondprojects.com/general/tutorials/xml/xml_a/whats-in-xml-1-1/

More reading from the official XML spec:
https://www.w3.org/TR/xml11schema10/

@zhongsdjn
Copy link

使用的go 1.17 需要对jenkins的xml进行解析 but Jenkins xml version is 1.1 ?How to deal with?

@zhongsdjn
Copy link

不明白为什么提了问题你们给关了?倒是给个解决的方案啊?说是和这个重复,那这个也都几年了还是没进度!感觉go是只关心核心进展

@ianlancetaylor
Copy link
Contributor

@zhongsdjn This issue tracker is primarily in English.

This issue is not closed. But as far as I know nobody is working on it. Go is an open source project. Would you like to send in patches for XML 1.1 support? Thanks.

@mengzhuo
Copy link
Contributor

mengzhuo commented Jan 12, 2022

使用的go 1.17 需要对jenkins的xml进行解析 but Jenkins xml version is 1.1 ?How to deal with?

Can you show more detail of Jenkins' xml file as an example?

@zhongsdjn
Copy link

zhongsdjn commented Jan 13, 2022

the error:
xml: unsupported version "1.1"; only version 1.0 is supported

but jenkins config file both xml 1.1
like flow:
<?xml version='1.1' encoding='UTF-8'?>
<hudson.util.DescribableList>
<hudson.node__monitors.ArchitectureMonitor>
false
</hudson.node__monitors.ArchitectureMonitor>
<hudson.node__monitors.ClockMonitor>
false
</hudson.node__monitors.ClockMonitor>
<hudson.node__monitors.DiskSpaceMonitor>
false
1GB
</hudson.node__monitors.DiskSpaceMonitor>
<hudson.node__monitors.SwapSpaceMonitor>
false
</hudson.node__monitors.SwapSpaceMonitor>
<hudson.node__monitors.TemporarySpaceMonitor>
false
1GB
</hudson.node__monitors.TemporarySpaceMonitor>
<hudson.node__monitors.ResponseTimeMonitor>
false
</hudson.node__monitors.ResponseTimeMonitor>
</hudson.util.DescribableList>

@jglick
Copy link

jglick commented Jan 13, 2022

jenkinsci/jenkins#3185 for the record. If you are using some Golang-based tool to manipulate Jenkins XML configurations (which?), pending this fix I suppose it would suffice to start by just stripping out any version='1.1' or version="1.1" from the first line of its input (should be fine to emit nothing or version='1.0' in output), and documenting that the tool will break in the rare case that control characters are present in text managed by the config file.

@anasbousselham
Copy link

Any update for xml 1.1!

@gopherbot
Copy link

Change https://go.dev/cl/452235 mentions this issue: encoding/xml: parser should not fail on XML version check in non-strict mode

@gitbeyond
Copy link

gitbeyond commented Apr 13, 2023

the error: xml: unsupported version "1.1"; only version 1.0 is supported

but jenkins config file both xml 1.1 like flow: <hudson.util.DescribableList> <hudson.node__monitors.ArchitectureMonitor> false </hudson.node__monitors.ArchitectureMonitor> <hudson.node__monitors.ClockMonitor> false </hudson.node__monitors.ClockMonitor> <hudson.node__monitors.DiskSpaceMonitor> false 1GB </hudson.node__monitors.DiskSpaceMonitor> <hudson.node__monitors.SwapSpaceMonitor> false </hudson.node__monitors.SwapSpaceMonitor> <hudson.node__monitors.TemporarySpaceMonitor> false 1GB </hudson.node__monitors.TemporarySpaceMonitor> <hudson.node__monitors.ResponseTimeMonitor> false </hudson.node__monitors.ResponseTimeMonitor> </hudson.util.DescribableList>

I also had this problem.
My solution is as follows:

  1. First replace version='1.1' with version='1.0'
  2. After the operation, replace version='1.0' with verison=1.1'

@nxk88998
Copy link

nxk88998 commented Feb 2, 2024

We need to support 1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

13 participants