Closed thomaszumbrunn closed 6 years ago
Can you perhaps include an example for me to test with?
Thanks for considering.
XML document
<?xml version="1.0" encoding="UTF-8"?>
<root/>
XSL document
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="text" encoding="UTF-8" media-type="text/plain" omit-xml-declaration="yes"/>
<xsl:param name="author" select="''"/>
<xsl:param name="reviewer" select="''"/>
<xsl:template match="root">
<xsl:text>author: </xsl:text><xsl:value-of select="$author"/><xsl:text> </xsl:text>
<xsl:text>reviewer: </xsl:text><xsl:value-of select="$reviewer"/><xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
xsltproc call
xsltproc --stringparam author "foo" --stringparam reviewer "bar" example.xsl example.xml
output of xsltproc call
author: foo
reviewer: bar
Can you test the dev version:
doc <- xml2::read_xml("~/Desktop/doc.xml")
style <- xml2::read_xml("~/Desktop/style.xml")
xslt::xml_xslt(doc, style, c(author="jeroen", reviewer="bert"))
Fabulous. Works as expected.
Thanks a lot for this package. (Up to now, I used a very primitive wrapper around 'xsltproc'.)
On CRAN now.
Hi Jeroen
It would be great if one could pass parameter values from 'xml_xslt' to the XSL stylesheet where those values are used instead of the default values specified in the corresponding elements. (In 'xsltproc', this is available via the --stringparam option.)
Cheers /thomas
BTW: Great work!