{"action":"opened","issue":{"url":"https://api.github.com/repos/hadley/xml2/issues/90","repository_url":"https://api.github.com/repos/hadley/xml2","labels_url":"https://api.github.com/repos/hadley/xml2/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/hadley/xml2/issues/90/comments","events_url":"https://api.github.com/repos/hadley/xml2/issues/90/events","html_url":"https://github.com/hadley/xml2/issues/90","id":155795302,"number":90,"title":"how do you use xml_find_chr() and friends?","user":{"login":"jennybc","id":599454,"avatar_url":"https://avatars.githubusercontent.com/u/599454?v=3","gravatar_id":"","url":"https://api.github.com/users/jennybc","html_url":"https://github.com/jennybc","followers_url":"https://api.github.com/users/jennybc/followers","following_url":"https://api.github.com/users/jennybc/following{/other_user}","gists_url":"https://api.github.com/users/jennybc/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybc/subscriptions","organizations_url":"https://api.github.com/users/jennybc/orgs","repos_url":"https://api.github.com/users/jennybc/repos","events_url":"https://api.github.com/users/jennybc/events{/privacy}","received_events_url":"https://api.github.com/users/jennybc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-19T17:46:14Z","updated_at":"2016-05-19T17:46:14Z","closed_at":null,"body":"Could you spare an example for `xml_find_chr()`? I assumed it would map `xml_text()` over a nodeset but I was wrong.\r\n\r\n``` r\r\nlibrary(xml2)\r\nlibrary(purrr)\r\nx <- read_xml('\r\n  <root xmlns = \"http://foo.com\">\r\n    <si>\r\n      <t>country</t>\r\n    </si>\r\n    <si>\r\n      <t>continent</t>\r\n    </si>\r\n  </root>\r\n  ')\r\nxml_find_all(x, \"//d1:t\", xml_ns(x)) %>% \r\n  map_chr(xml_text)\r\n#> [1] \"country\"   \"continent\"\r\nxml_find_chr(x, \"//d1:t\", xml_ns(x))\r\n#> Error: result of type: 'list', not character\r\n```"}}