ropensci / xslt

Extension of xml2 package for xsl transformations
https://docs.ropensci.org/xslt
27 stars 1 forks source link

encoding bug? #6

Open maelle opened 5 years ago

maelle commented 5 years ago
stylesheet <- xml2::read_xml("https://raw.githubusercontent.com/ropenscilabs/tinkr/master/inst/extdata/xml2md.xsl")
doc <- readLines("https://raw.githubusercontent.com/ropensci/roweb2/master/content/blog/2013-11-21-rgbif-changes.md",
                 encoding = "UTF-8")
doc <- commonmark::markdown_xml(doc)
doc <- xml2::read_xml(doc)
output <- xslt::xml_xslt(doc, stylesheet)
regmatches(output, regexpr(".partements", output))
#> [1] "©partements"
regmatches(toString(doc), 
           regexpr(".partements", toString(doc)))
#> [1] "épartements"

Created on 2018-09-17 by the reprex package (v0.2.0).