{"action":"opened","issue":{"url":"https://api.github.com/repos/hadley/rvest/issues/69","labels_url":"https://api.github.com/repos/hadley/rvest/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/hadley/rvest/issues/69/comments","events_url":"https://api.github.com/repos/hadley/rvest/issues/69/events","html_url":"https://github.com/hadley/rvest/issues/69","id":60246126,"number":69,"title":"XML nodes and attributes converted to lower case","user":{"login":"richierocks","id":197589,"avatar_url":"https://avatars.githubusercontent.com/u/197589?v=3","gravatar_id":"","url":"https://api.github.com/users/richierocks","html_url":"https://github.com/richierocks","followers_url":"https://api.github.com/users/richierocks/followers","following_url":"https://api.github.com/users/richierocks/following{/other_user}","gists_url":"https://api.github.com/users/richierocks/gists{/gist_id}","starred_url":"https://api.github.com/users/richierocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richierocks/subscriptions","organizations_url":"https://api.github.com/users/richierocks/orgs","repos_url":"https://api.github.com/users/richierocks/repos","events_url":"https://api.github.com/users/richierocks/events{/privacy}","received_events_url":"https://api.github.com/users/richierocks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-08T07:45:45Z","updated_at":"2015-03-08T07:45:45Z","closed_at":null,"body":"This seems to be a consequence of using `XML::htmlParse` rather than `XML::xmlParse`.\r\n\r\nTo reproduce\r\n\r\n```{r}\r\nxml_string <- '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<topLevelItem>  \r\n  <midLevelItem ID = \"1\">\r\n    <bottomLevelItem>Some Text</bottomLevelItem>\r\n  </midLevelItem>\r\n  <midLevelItem ID = \"2\">\r\n  <bottomLevelItem>Some More Text</bottomLevelItem>\r\n  </midLevelItem>  \r\n</topLevelItem>'\r\nxml(xml_string)\r\n## <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\r\n##   <?xml version=\"1.0\" encoding=\"utf-8\"?><html><body><toplevelitem><midlevelitem id=\"1\"><bottomlevelitem>Some Text</bottomlevelitem></midlevelitem><midlevelitem id=\"2\"><bottomlevelitem>Some More Text</bottomlevelitem></midlevelitem></toplevelitem></body></html>\r\n```\r\n\r\nThe `xml` function is essentially calling\r\n\r\n```{r}\r\nrvest:::parse.character(xml_string, XML::htmlParse)\r\n```\r\n\r\nIf we change this to `xmlParse` then the case is preserved for nodes and attributes, as expected.\r\n\r\n```{r}\r\nrvest:::parse.character(xml_string, XML::xmlParse)\r\n## <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n## <topLevelItem>\r\n##   <midLevelItem ID=\"1\">\r\n##     <bottomLevelItem>Some Text</bottomLevelItem>\r\n##   </midLevelItem>\r\n##   <midLevelItem ID=\"2\">\r\n##     <bottomLevelItem>Some More Text</bottomLevelItem>\r\n##   </midLevelItem>\r\n## </topLevelItem>\r\n```\r\n\r\n\r\n\r\n\r\n\r\n"}}