Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48463

Jenkins should create xml 1.1 output in order to support control characters that are illegal in xml 1.0

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      The current implementation of XmlFile.java emits an XML 1.0 header, which breaks things like Move/Copy/Promote if the user has included any characters that are illegal in XML 1.0 (such as Control-XX, etc) in their jobs.
      XStream, which is used for serialization/deserialization, deals with XML fragments, and doesn't have an issue reading/writing this non well-formed XML. Changing XmlFile.java so that it creates xml 1.1  here will allow jenkins config files to support these special characters. This also requires updating the underlying XML Pull Parser being used by XStream to something that support XML v1.1

          [JENKINS-48463] Jenkins should create xml 1.1 output in order to support control characters that are illegal in xml 1.0

          mike cirioli added a comment - - edited

          Note:  Benchmarks comparing XML Parser performance can be found here:  http://x-stream.github.io/benchmarks.html

           

          Previously Jenkins was using XPP (Xpp3 min 1.1.4c), and has now been switched to XPP (kXML2 min 2.3.0).  Investigating the use of other drivers my be useful in the future for even greater performance gains (assuming they support XML v1.1).  Currently there are limitations in the drivers we can use because of forked XStream dependency.  

          mike cirioli added a comment - - edited Note:  Benchmarks comparing XML Parser performance can be found here:  http://x-stream.github.io/benchmarks.html   Previously Jenkins was using XPP (Xpp3 min 1.1.4c), and has now been switched to XPP (kXML2 min 2.3.0).  Investigating the use of other drivers my be useful in the future for even greater performance gains (assuming they support XML v1.1).  Currently there are limitations in the drivers we can use because of forked XStream dependency.  

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/main/java/hudson/Main.java
          core/src/main/java/hudson/XmlFile.java
          core/src/main/java/hudson/model/Fingerprint.java
          core/src/main/java/hudson/util/XStream2.java
          core/src/test/java/hudson/PluginManagerTest.java
          core/src/test/java/hudson/util/XStream2EncodingTest.java
          core/src/test/java/jenkins/model/RunIdMigratorTest.java
          core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java
          core/src/test/java/jenkins/xml/XMLUtilsTest.java
          test/src/test/java/hudson/cli/GetNodeCommandTest.java
          test/src/test/java/hudson/cli/GetViewCommandTest.java
          test/src/test/java/hudson/model/AbstractItemSecurityTest.java
          test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java
          test/src/test/java/hudson/model/ItemGroupMixInTest.java
          test/src/test/java/hudson/util/RobustReflectionConverterTest.java
          http://jenkins-ci.org/commit/jenkins/9a4a913e387c49d0c4cec602280e25c37196f83c
          Log:
          JENKINS-48463 - update jenkins core to use xml v1.1

          • switched to KxmlDriver (needed for xml 1.1 support)
          • updated to create xml v1.1 headers
          • updated test to use KXml2Driver explicitly
          • updated unit tests to support xml v1.1

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/main/java/hudson/Main.java core/src/main/java/hudson/XmlFile.java core/src/main/java/hudson/model/Fingerprint.java core/src/main/java/hudson/util/XStream2.java core/src/test/java/hudson/PluginManagerTest.java core/src/test/java/hudson/util/XStream2EncodingTest.java core/src/test/java/jenkins/model/RunIdMigratorTest.java core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java core/src/test/java/jenkins/xml/XMLUtilsTest.java test/src/test/java/hudson/cli/GetNodeCommandTest.java test/src/test/java/hudson/cli/GetViewCommandTest.java test/src/test/java/hudson/model/AbstractItemSecurityTest.java test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java test/src/test/java/hudson/model/ItemGroupMixInTest.java test/src/test/java/hudson/util/RobustReflectionConverterTest.java http://jenkins-ci.org/commit/jenkins/9a4a913e387c49d0c4cec602280e25c37196f83c Log: JENKINS-48463 - update jenkins core to use xml v1.1 switched to KxmlDriver (needed for xml 1.1 support) updated to create xml v1.1 headers updated test to use KXml2Driver explicitly updated unit tests to support xml v1.1

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/main/java/hudson/model/View.java
          core/src/main/java/jenkins/util/xstream/XStreamDOM.java
          http://jenkins-ci.org/commit/jenkins/37365eeca7e8683920dd0d13f039e36380f19e24
          Log:
          JENKINS-48463 update hard coded references of XPP3Driver to KXml2Driver in order to support XMLv1.1

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/main/java/hudson/model/View.java core/src/main/java/jenkins/util/xstream/XStreamDOM.java http://jenkins-ci.org/commit/jenkins/37365eeca7e8683920dd0d13f039e36380f19e24 Log: JENKINS-48463 update hard coded references of XPP3Driver to KXml2Driver in order to support XMLv1.1

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/main/java/hudson/XmlFile.java
          core/src/main/java/hudson/model/View.java
          core/src/main/java/hudson/util/XStream2.java
          core/src/main/java/jenkins/util/xstream/XStreamDOM.java
          core/src/test/java/hudson/PluginManagerTest.java
          core/src/test/java/hudson/util/XStream2EncodingTest.java
          core/src/test/java/jenkins/model/RunIdMigratorTest.java
          core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java
          core/src/test/java/jenkins/xml/XMLUtilsTest.java
          test/src/test/java/hudson/model/AbstractItemSecurityTest.java
          test/src/test/java/hudson/model/ItemGroupMixInTest.java
          http://jenkins-ci.org/commit/jenkins/570b52dbcc4e6b2555bb8080994d30cc7228f9ca
          Log:
          JENKINS-48463 refactored XStream2 to default to KXml2Driver by default.
          Changed all explicit references of the hierarchical driver to use a static
          convinience method XStream2.getDefaultDriver() to ensure all XML operations
          are using the same driver.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/main/java/hudson/XmlFile.java core/src/main/java/hudson/model/View.java core/src/main/java/hudson/util/XStream2.java core/src/main/java/jenkins/util/xstream/XStreamDOM.java core/src/test/java/hudson/PluginManagerTest.java core/src/test/java/hudson/util/XStream2EncodingTest.java core/src/test/java/jenkins/model/RunIdMigratorTest.java core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java core/src/test/java/jenkins/xml/XMLUtilsTest.java test/src/test/java/hudson/model/AbstractItemSecurityTest.java test/src/test/java/hudson/model/ItemGroupMixInTest.java http://jenkins-ci.org/commit/jenkins/570b52dbcc4e6b2555bb8080994d30cc7228f9ca Log: JENKINS-48463 refactored XStream2 to default to KXml2Driver by default. Changed all explicit references of the hierarchical driver to use a static convinience method XStream2.getDefaultDriver() to ensure all XML operations are using the same driver.

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/test/java/hudson/XmlFileTest.java
          core/src/test/resources/hudson/confg_1_1_with_special_chars.xml
          core/src/test/resources/hudson/config_1_0.xml
          core/src/test/resources/hudson/config_1_1.xml
          pom.xml
          test/src/test/java/hudson/XMLFileTest.java
          test/src/test/resources/hudson/XMLFileTest/canStartWithXml_1_1_ConfigsTest/config.xml
          http://jenkins-ci.org/commit/jenkins/24a1852fc2c9a74c59a25c3e0ed022e315894344
          Log:
          JENKINS-48463 Added additional unit tests for verifying xml v1.1 compatibility

          • verify can still read xml 1.0
          • verify can read xml 1.1
          • verify can read xml 1.1 with 'special' characters
          • verify that jenkins can start with a config.xml having
            <?xml version='1.1'> and special characters

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/test/java/hudson/XmlFileTest.java core/src/test/resources/hudson/confg_1_1_with_special_chars.xml core/src/test/resources/hudson/config_1_0.xml core/src/test/resources/hudson/config_1_1.xml pom.xml test/src/test/java/hudson/XMLFileTest.java test/src/test/resources/hudson/XMLFileTest/canStartWithXml_1_1_ConfigsTest/config.xml http://jenkins-ci.org/commit/jenkins/24a1852fc2c9a74c59a25c3e0ed022e315894344 Log: JENKINS-48463 Added additional unit tests for verifying xml v1.1 compatibility verify can still read xml 1.0 verify can read xml 1.1 verify can read xml 1.1 with 'special' characters verify that jenkins can start with a config.xml having <?xml version='1.1'> and special characters

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/test/java/hudson/XmlFileTest.java
          test/src/test/java/hudson/XMLFileTest.java
          test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml
          http://jenkins-ci.org/commit/jenkins/b9c2148d6e53ef4c7f0f01fab591b0333b4c69f1
          Log:
          JENKINS-48463 Added a unit test that validates jenkins xml v1.0 configs
          are silently migrated to xml v1.1 as they are persisted

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/test/java/hudson/XmlFileTest.java test/src/test/java/hudson/XMLFileTest.java test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml http://jenkins-ci.org/commit/jenkins/b9c2148d6e53ef4c7f0f01fab591b0333b4c69f1 Log: JENKINS-48463 Added a unit test that validates jenkins xml v1.0 configs are silently migrated to xml v1.1 as they are persisted

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/test/java/hudson/XmlFileTest.java
          core/src/test/resources/hudson/confg_1_1_with_special_chars.xml
          core/src/test/resources/hudson/config_1_0_with_special_chars.xml
          core/src/test/resources/hudson/config_1_1_with_special_chars.xml
          test/src/test/java/hudson/XMLFileTest.java
          test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml
          http://jenkins-ci.org/commit/jenkins/a0f419120b72b3e645f5beb7b5213ae01cc58364
          Log:
          JENKINS-48463 It appears that the KXml2Driver is more tolerant of
          technically illegal xml (ie. it doesn't complain if an Xml v1.0 file
          contains special characters). Added a unit test that proves this, as well
          as fixing silentlyMigrateConfigsTest so that it starts with technically
          valid Xml 1.0 content

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/test/java/hudson/XmlFileTest.java core/src/test/resources/hudson/confg_1_1_with_special_chars.xml core/src/test/resources/hudson/config_1_0_with_special_chars.xml core/src/test/resources/hudson/config_1_1_with_special_chars.xml test/src/test/java/hudson/XMLFileTest.java test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml http://jenkins-ci.org/commit/jenkins/a0f419120b72b3e645f5beb7b5213ae01cc58364 Log: JENKINS-48463 It appears that the KXml2Driver is more tolerant of technically illegal xml (ie. it doesn't complain if an Xml v1.0 file contains special characters). Added a unit test that proves this, as well as fixing silentlyMigrateConfigsTest so that it starts with technically valid Xml 1.0 content

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/test/java/hudson/XmlFileTest.java
          http://jenkins-ci.org/commit/jenkins/0431cc75fd2745335a8e06c75697890ef049df79
          Log:
          JENKINS-48463 - Ignoring test xml1_0_withSpecialCharsShouldFail due to
          KXml2Driver being tolerant of control characters which should be illegal
          in an XML v1.0 content. This test should be revisted if we switch to
          another XML driver

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/test/java/hudson/XmlFileTest.java http://jenkins-ci.org/commit/jenkins/0431cc75fd2745335a8e06c75697890ef049df79 Log: JENKINS-48463 - Ignoring test xml1_0_withSpecialCharsShouldFail due to KXml2Driver being tolerant of control characters which should be illegal in an XML v1.0 content. This test should be revisted if we switch to another XML driver

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/src/main/java/hudson/model/View.java
          core/src/test/java/hudson/util/XStream2Test.java
          http://jenkins-ci.org/commit/jenkins/992100ac4223b3d5eab11e8dccae5e55c2a18484
          Log:
          JENKINS-48463 - fixed reference to deprecated Xpp3Driver and replaced with
          new default driver

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/src/main/java/hudson/model/View.java core/src/test/java/hudson/util/XStream2Test.java http://jenkins-ci.org/commit/jenkins/992100ac4223b3d5eab11e8dccae5e55c2a18484 Log: JENKINS-48463 - fixed reference to deprecated Xpp3Driver and replaced with new default driver

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/d994e65a9a380908cfd6ac3e4c41c9f2040d9a73
          Log:
          JENKINS-48463 Erring on the side of caution and incuding xpp3 libs back
          in, just in case some plugin might be depending on them

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/d994e65a9a380908cfd6ac3e4c41c9f2040d9a73 Log: JENKINS-48463 Erring on the side of caution and incuding xpp3 libs back in, just in case some plugin might be depending on them

          Code changed in jenkins
          User: mike cirioli
          Path:
          core/pom.xml
          core/src/main/java/hudson/util/XStream2.java
          core/src/test/java/hudson/XmlFileTest.java
          test/src/test/java/hudson/XMLFileTest.java
          http://jenkins-ci.org/commit/jenkins/5f0f9f2b87be0a2d2c1dfb34df59db117f9ea90f
          Log:
          JENKINS-48463 added try-with-resources to XmlFileTest to ensure proper
          file handle cleanup in the event of failure

          Fixed small nits regarding typo's and code cleanup
          Added comment explaining why Xpp3 is still included as a dep

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mike cirioli Path: core/pom.xml core/src/main/java/hudson/util/XStream2.java core/src/test/java/hudson/XmlFileTest.java test/src/test/java/hudson/XMLFileTest.java http://jenkins-ci.org/commit/jenkins/5f0f9f2b87be0a2d2c1dfb34df59db117f9ea90f Log: JENKINS-48463 added try-with-resources to XmlFileTest to ensure proper file handle cleanup in the event of failure Fixed small nits regarding typo's and code cleanup Added comment explaining why Xpp3 is still included as a dep

          Code changed in jenkins
          User: Baptiste Mathus
          Path:
          core/pom.xml
          core/src/main/java/hudson/Main.java
          core/src/main/java/hudson/XmlFile.java
          core/src/main/java/hudson/model/Fingerprint.java
          core/src/main/java/hudson/model/View.java
          core/src/main/java/hudson/util/XStream2.java
          core/src/main/java/jenkins/util/xstream/XStreamDOM.java
          core/src/test/java/hudson/XmlFileTest.java
          core/src/test/java/hudson/util/XStream2Test.java
          core/src/test/resources/hudson/config_1_0.xml
          core/src/test/resources/hudson/config_1_0_with_special_chars.xml
          core/src/test/resources/hudson/config_1_1.xml
          core/src/test/resources/hudson/config_1_1_with_special_chars.xml
          pom.xml
          test/src/test/java/hudson/XMLFileTest.java
          test/src/test/java/hudson/cli/GetNodeCommandTest.java
          test/src/test/java/hudson/cli/GetViewCommandTest.java
          test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java
          test/src/test/java/hudson/util/RobustReflectionConverterTest.java
          test/src/test/resources/hudson/XMLFileTest/canStartWithXml_1_1_ConfigsTest/config.xml
          test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml
          http://jenkins-ci.org/commit/jenkins/0c17e82e825dee9c91ee8c484aefc37e2fb2be21
          Log:
          Merge pull request #3185 from mikecirioli/OSS-2590

          JENKINS-48463 Update jenkins core to use XML v1.1

          Compare: https://github.com/jenkinsci/jenkins/compare/bff2d2a39901...0c17e82e825d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Baptiste Mathus Path: core/pom.xml core/src/main/java/hudson/Main.java core/src/main/java/hudson/XmlFile.java core/src/main/java/hudson/model/Fingerprint.java core/src/main/java/hudson/model/View.java core/src/main/java/hudson/util/XStream2.java core/src/main/java/jenkins/util/xstream/XStreamDOM.java core/src/test/java/hudson/XmlFileTest.java core/src/test/java/hudson/util/XStream2Test.java core/src/test/resources/hudson/config_1_0.xml core/src/test/resources/hudson/config_1_0_with_special_chars.xml core/src/test/resources/hudson/config_1_1.xml core/src/test/resources/hudson/config_1_1_with_special_chars.xml pom.xml test/src/test/java/hudson/XMLFileTest.java test/src/test/java/hudson/cli/GetNodeCommandTest.java test/src/test/java/hudson/cli/GetViewCommandTest.java test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java test/src/test/java/hudson/util/RobustReflectionConverterTest.java test/src/test/resources/hudson/XMLFileTest/canStartWithXml_1_1_ConfigsTest/config.xml test/src/test/resources/hudson/XMLFileTest/silentlyMigrateConfigsTest/config.xml http://jenkins-ci.org/commit/jenkins/0c17e82e825dee9c91ee8c484aefc37e2fb2be21 Log: Merge pull request #3185 from mikecirioli/OSS-2590 JENKINS-48463 Update jenkins core to use XML v1.1 Compare: https://github.com/jenkinsci/jenkins/compare/bff2d2a39901...0c17e82e825d

          Fixed in 2.105

          Baptiste Mathus added a comment - Fixed in 2.105

          Does anyone have a good recommendation for an XML 1.1 Parser. We are a .NET-shop.  But, Microsoft's standard XML parsers don't support XML 1.1. 

          Looking around the internet, I see a lot of "workarounds", but not any parsers that actually support version 1.1.  My application is not performance-critical, so anything that converts XML 1.1 into another supported language (JSON, XML 1.0, YAML, protobuf, etc) would be fine.

          Andrew Lamonica added a comment - Does anyone have a good recommendation for an XML 1.1 Parser. We are a .NET-shop.  But, Microsoft's standard XML parsers don't support XML 1.1.  Looking around the internet, I see a lot of "workarounds", but not any parsers that actually support version 1.1.  My application is not performance-critical, so anything that converts XML 1.1 into another supported language (JSON, XML 1.0, YAML, protobuf, etc) would be fine.

          mike cirioli added a comment -

          Assuming you don't need to support special characters (like control characters) you could just change the xml declartion to be v1.0 

          <?xml version="1.0"?>

          and then process the file with whatever tools you currently use.

          mike cirioli added a comment - Assuming you don't need to support special characters (like control characters) you could just change the xml declartion to be v1.0  <?xml version="1.0"?> and then process the file with whatever tools you currently use.

          mikecirioli, yeah.  That's the "workaround" mentioned most places.  I was trying to set a good example to some junior employees.  But, it seems that XML1.1 is just not widely supported and has even been declared "dead".

          I had a look at the code for this change in Jenkins and they are just hard-coding in the version number.  So, we are probably pretty safe to just remedy this "hard-coded quirk" with a "hard-coded undo" in our code.

          Thanks for attempting to help.

          P.S. For people who are not attempting to do what we are doing (backing up configs), there is a JSON API that can be used in place of the XML.

          Andrew Lamonica added a comment - mikecirioli , yeah.  That's the "workaround" mentioned most places.  I was trying to set a good example to some junior employees.  But, it seems that XML1.1 is just not widely supported and has even been declared " dead ". I had a look at the code for this change in Jenkins and they are just hard-coding in the version number.  So, we are probably pretty safe to just remedy this "hard-coded quirk" with a "hard-coded undo" in our code. Thanks for attempting to help. P.S. For people who are not attempting to do what we are doing (backing up configs), there is a JSON API that can be used in place of the XML.

          Robert Pitt added a comment -

          As another Windows/.NET organisation the move to XML 1.1 has impacting us as well.
          After a google it seems that XML 1.1 is not well supported; moving Jenkins to 1.1 is regrettable.
          Realistically though I don't imagine this change to be rolled back, we're going to have to hack our code.

          Robert Pitt added a comment - As another Windows/.NET organisation the move to XML 1.1 has impacting us as well. After a google it seems that XML 1.1 is not well supported; moving Jenkins to 1.1 is regrettable. Realistically though I don't imagine this change to be rolled back, we're going to have to hack our code.

          Not sure how and why this is impacting anything, but I would recommend you possibly take that as an opportunity to take a step back.

          AKAIK, the XML format of Jenkins has always been considered an internal format, and could pretty well change anytime again in the near future, as for instance architectural changes are happening currently to evolve Jenkins.

          So rpitt and rlamoni, I think this would be great if you people can come to the mailing lists, or explain what you are currently doing that impacted you. 

          For instance, if you are generating jobs, then you want to look at the Job DSL plugin. If you want to configure Jenkins, possibly look at the very active https://github.com/jenkinsci/configuration-as-code-plugin

          In any case, again, I would strongly recommend people to avoid generating Jenkins' XML, or come to explain what the use case is so that it can be supported durably, for the benefit of everyone.

          Because, well, in that very case, updating to XML 1.1, a technology published in 2004 was probably long overdue anyway.

          Baptiste Mathus added a comment - Not sure how and why this is impacting anything, but I would recommend you possibly take that as an opportunity to take a step back. AKAIK, the XML format of Jenkins has always been considered an internal format, and could pretty well change anytime again  in the near future, as for instance architectural changes are happening currently to evolve Jenkins. So rpitt and rlamoni , I think this would be great if you people can come to the mailing lists, or explain what you are currently doing that impacted you.  For instance, if you are generating jobs, then you want to look at the Job DSL plugin . If you want to configure Jenkins, possibly look at the very active https://github.com/jenkinsci/configuration-as-code-plugin In any case, again, I would strongly recommend people to avoid generating Jenkins' XML, or come to explain what the use case is so that it can be supported durably, for the benefit of everyone. Because, well, in that very case, updating to XML 1.1, a technology published in 2004 was probably long overdue anyway.

          batmat, I'm not sure you are helping the XML1.1-argument when you remind people that XML 1.1 was published in 2004. Any software standard that is not well-supported after more than a decade is not likely to suddenly gain widespread acceptance.

          But, as I mentioned before, it looks like Jenkins isn't really doing XML 1.1, anyway.  The code is just emitting the header, then doing business-as-usual for the body.  That's weird, but not a deal breaker.  No one is going to switch away from a great technology like Jenkins just because they have to do a little text-replacing when using one of the APIs.

          I'm not sure what mailing list you think I should join.  But, I can give a quick explanation of what we are using the XML for.

          My company tracks changes to configurations of most of our off-the-shelf and open-source software (as well as some hardware) in something we call the "recovery system".  This recovery system is a little like an automated backup, except that it can be used to easily view changes made to confirmations. The system is often the first place people go where there is a mysterious service disruption since it aggregates all changes together into a single timeline.

          The code our "recovery system" uses to extract Jenkins' would be more-or-less agnostic to XML-type (since it largely doesn't care about the format of the configuration it is backing up) except that it gets a lists of things to track by inspecting the output of other XML APIs. (such as jankins.hostname/api/xml).  At time of writing this, I'm not 100% sure which API calls were failing to parse, since the person on my team who fixed this did so in a very-general way and it's unlikely all of them failed (given my example doesn't have a header at all).  But, maybe I can provide more details after locating the mailing-list.

          Cheers.

          Andrew Lamonica added a comment - batmat , I'm not sure you are helping the XML1.1-argument when you remind people that XML 1.1 was published in 2004. Any software standard that is not well-supported after more than a decade is not likely to suddenly gain widespread acceptance. But, as I mentioned before, it looks like Jenkins isn't really doing XML 1.1, anyway.  The code is just emitting the header, then doing business-as-usual for the body.  That's weird, but not a deal breaker.  No one is going to switch away from a great technology like Jenkins just because they have to do a little text-replacing when using one of the APIs. I'm not sure what mailing list you think I should join.  But, I can give a quick explanation of what we are using the XML for. My company tracks changes to configurations of most of our off-the-shelf and open-source software (as well as some hardware) in something we call the "recovery system".  This recovery system is a little like an automated backup, except that it can be used to easily view changes made to confirmations. The system is often the first place people go where there is a mysterious service disruption since it aggregates all changes together into a single timeline. The code our "recovery system" uses to extract Jenkins' would be more-or-less agnostic to XML-type (since it largely doesn't care about the format of the configuration it is backing up) except that it gets a lists of things to track by inspecting the output of other XML APIs. (such as jankins.hostname/api/xml).  At time of writing this, I'm not 100% sure which API calls were failing to parse, since the person on my team who fixed this did so in a very-general way and it's unlikely all of them failed (given my example doesn't have a header at all).  But, maybe I can provide more details after locating the mailing-list. Cheers.

          Aaron Jensen added a comment -

          Please roll this back. We automate Jenkins using .NET and it doesn't support XML 1.1. It won't even open/parse any XML 1.1 files.

          Aaron Jensen added a comment - Please roll this back. We automate Jenkins using .NET and it doesn't support XML 1.1. It won't even open/parse any XML 1.1 files.

          Aaron Jensen added a comment -

          If the config.xml file format is considered internal, Jenkins shouldn't have APIs that expose it. That's not internal.

          Aaron Jensen added a comment - If the config.xml file format is considered internal, Jenkins shouldn't have APIs that expose it. That's not internal.

          Aaron Jensen added a comment -

          Here's our use-case: Developers have certain golden paths for creating specific types of applications. We have templates in Jenkins for each type. Developers run a build to create a new application. We grab the config.xml from the template, update it to use values specific to the new job, then post that config.xml to Jenkins to create the job.

          Switching to the two plug-ins mentioned is a big under-taking. We have to learn Groovy and/or export our entire Jenkins configuration as YAML and write automation to apply it. Given enough warning, we could do it. This feature should be rolled back, then announced that it's coming with instructions on how to migrate to some way of managing job configurations without touching config.xml files. Then the config.xml file format can become internal and you can change to 1.1 if you want and this could get refiled as "allow job configuration to include control characters".

          Aaron Jensen added a comment - Here's our use-case: Developers have certain golden paths for creating specific types of applications. We have templates in Jenkins for each type. Developers run a build to create a new application. We grab the config.xml from the template, update it to use values specific to the new job, then post that config.xml to Jenkins to create the job. Switching to the two plug-ins mentioned is a big under-taking. We have to learn Groovy and/or export our entire Jenkins configuration as YAML and write automation to apply it. Given enough warning, we could do it. This feature should be rolled back, then announced that it's coming with instructions on how to migrate to some way of managing job configurations without touching config.xml files. Then the config.xml file format can become internal and you can change to 1.1 if you want and this could get refiled as "allow job configuration to include control characters".

          Andrew Lamonica added a comment - splatteredbits , here is what we ended up doing.  https://paste.ofcode.org/3aPEN9YyVDEcCGM2JmX8zw

          You must note that most editors that work fine with XML 1.0 can't parse XML 1.1. After more than a decade successfully using the free MS utility XML Notepad for all XML tasks I may have to look for another editor. How much of a demand there was for this change?

          Ioannis Moutsatsos added a comment - You must note that most editors that work fine with XML 1.0 can't parse XML 1.1. After more than a decade successfully using the free MS utility XML Notepad for all XML tasks I may have to look for another editor. How much of a demand there was for this change?

          James Howe added a comment - - edited

          Just to add, as far as I can tell you only need 1.1 if you've got control characters in names (i.e. of tags and attributes).
          Surely if people are putting them in their configuration it's in text content, where 1.0 works just fine with standard escapes.

          Not only does .NET not support xml 1.1 but neither does Firefox, nor any of my editors.

          James Howe added a comment - - edited Just to add, as far as I can tell you only need 1.1 if you've got control characters in names (i.e. of tags and attributes). Surely if people are putting them in their configuration it's in text content, where 1.0 works just fine with standard escapes. Not only does .NET not support xml 1.1 but neither does Firefox, nor any of my editors.

            mikecirioli mike cirioli
            mikecirioli mike cirioli
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: