{"action":"closed","issue":{"url":"https://api.github.com/repos/EasyBatch/easybatch-framework/issues/68","labels_url":"https://api.github.com/repos/EasyBatch/easybatch-framework/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/EasyBatch/easybatch-framework/issues/68/comments","events_url":"https://api.github.com/repos/EasyBatch/easybatch-framework/issues/68/events","html_url":"https://github.com/EasyBatch/easybatch-framework/issues/68","id":88257903,"number":68,"title":"Invalid XML when reading XML content with custom namespace","user":{"login":"benas","id":1210553,"avatar_url":"https://avatars.githubusercontent.com/u/1210553?v=3","gravatar_id":"","url":"https://api.github.com/users/benas","html_url":"https://github.com/benas","followers_url":"https://api.github.com/users/benas/followers","following_url":"https://api.github.com/users/benas/following{/other_user}","gists_url":"https://api.github.com/users/benas/gists{/gist_id}","starred_url":"https://api.github.com/users/benas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benas/subscriptions","organizations_url":"https://api.github.com/users/benas/orgs","repos_url":"https://api.github.com/users/benas/repos","events_url":"https://api.github.com/users/benas/events{/privacy}","received_events_url":"https://api.github.com/users/benas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/EasyBatch/easybatch-framework/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"benas","id":1210553,"avatar_url":"https://avatars.githubusercontent.com/u/1210553?v=3","gravatar_id":"","url":"https://api.github.com/users/benas","html_url":"https://github.com/benas","followers_url":"https://api.github.com/users/benas/followers","following_url":"https://api.github.com/users/benas/following{/other_user}","gists_url":"https://api.github.com/users/benas/gists{/gist_id}","starred_url":"https://api.github.com/users/benas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benas/subscriptions","organizations_url":"https://api.github.com/users/benas/orgs","repos_url":"https://api.github.com/users/benas/repos","events_url":"https://api.github.com/users/benas/events{/privacy}","received_events_url":"https://api.github.com/users/benas/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/EasyBatch/easybatch-framework/milestones/3","html_url":"https://github.com/EasyBatch/easybatch-framework/milestones/3.0.3","labels_url":"https://api.github.com/repos/EasyBatch/easybatch-framework/milestones/3/labels","id":1163985,"number":3,"title":"3.0.3","description":"","creator":{"login":"benas","id":1210553,"avatar_url":"https://avatars.githubusercontent.com/u/1210553?v=3","gravatar_id":"","url":"https://api.github.com/users/benas","html_url":"https://github.com/benas","followers_url":"https://api.github.com/users/benas/followers","following_url":"https://api.github.com/users/benas/following{/other_user}","gists_url":"https://api.github.com/users/benas/gists{/gist_id}","starred_url":"https://api.github.com/users/benas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benas/subscriptions","organizations_url":"https://api.github.com/users/benas/orgs","repos_url":"https://api.github.com/users/benas/repos","events_url":"https://api.github.com/users/benas/events{/privacy}","received_events_url":"https://api.github.com/users/benas/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":2,"state":"open","created_at":"2015-06-14T21:11:38Z","updated_at":"2015-06-16T20:38:57Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-06-14T22:23:19Z","updated_at":"2015-06-16T20:38:57Z","closed_at":"2015-06-16T20:38:57Z","body":"When the XML data source declares a custom namespace, the `XmlRecordreader` writes the fully qualified namespace name in each tag which leads to invalid xml content. Here is a failing test with version 3.0.2:\r\n\r\nThe data source is the following:\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<b:beans xmlns:b=\"http://www.springframework.org/schema/beans\"\r\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n       xsi:schemaLocation=\" http://www.springframework.org/schema/beans\r\n        http://www.springframework.org/schema/beans/spring-beans.xsd\">\r\n\r\n    <b:bean id=\"foo\" class=\"java.lang.String\"></b:bean>\r\n    <b:bean id=\"bar\" class=\"java.lang.String\"/>\r\n\r\n</b:beans>\r\n```\r\n\r\nThe reader creates two records with the following payloads:\r\n```xml\r\n<{http://www.springframework.org/schema/beans}bean id='foo' class='java.lang.String'></['http://www.springframework.org/schema/beans']:b:bean>\r\n<{http://www.springframework.org/schema/beans}bean id='bar' class='java.lang.String'></['http://www.springframework.org/schema/beans']:b:bean>\r\n```\r\n\r\nThe failing test:\r\n\r\n```java\r\n    @Test\r\n    public void testReadingXmlWithCustomNamespace() throws Exception {\r\n        xmlRecordReader.close();\r\n        xmlRecordReader = new XmlRecordReader(\"bean\", getDataSource(\"/beans.xml\"));\r\n        xmlRecordReader.open();\r\n\r\n        assertThat(xmlRecordReader.hasNextRecord()).isTrue();\r\n        XmlRecord record = xmlRecordReader.readNextRecord();\r\n        assertThat(record.getPayload()).isXmlEqualTo(\"<bean id=\\\"foo\\\" class=\\\"java.lang.String\\\"/>\");\r\n\r\n        assertThat(xmlRecordReader.hasNextRecord()).isTrue();\r\n        record = xmlRecordReader.readNextRecord();\r\n        assertThat(record.getPayload()).isXmlEqualTo(\"<bean id=\\\"bar\\\" class=\\\"java.lang.String\\\"/>\");\r\n\r\n        assertThat(xmlRecordReader.hasNextRecord()).isFalse();\r\n\r\n    }\r\n```\r\n\r\nAnd the exception thrown:\r\n\r\n```\r\n[Fatal Error] :1:2: The markup in the document preceding the root element must be well-formed.\r\nCaused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; The markup in the document preceding the root element must be well-formed.\r\n\tat com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)\r\n\tat org.assertj.core.util.xml.XmlStringPrettyFormatter.toXmlDocument(XmlStringPrettyFormatter.java:58)\r\n\t... 32 more\r\n``"}}