Re: [xslt] Pull request : xsltproc --fileparam



On 2018-01-17 13:34:07 +0100, Nick Wellnhofer wrote:
On 15/01/2018 22:50, Edouard Tisserant wrote:
I added a --fileparam switch to xsltproc command line to enable loading
file content as stylesheet parameter string literal. It also enhance
--stringparam as a side effect. I hope you'll find this useful.

$ xsltproc --param param "2+3" --stringparam stringparam "2+3"
--fileparam fileparam test.txt test.xsl test.xml
<?xml version="1.0"?>
<param>5</param><stringparam>2+3</stringparam><fileparam>Hello World
</fileparam>

Why don't you simply use something like

    --stringparam fileparam "$(cat test.txt)"

What if the text is too long for the command line?

Moreover, $() is lossy as it strips the trailing \n characters.

-- 
Vincent Lefèvre <vincent vinc17 net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]