WP-CLI

All three (3) shortcodes have command-line equivalents. The syntax is a little different, but the options are the same. Commands can be used to run quick tests. Or they can be used, for instance, to pre-generate content by piping the outputs into files.


wp xslt transform_xml
    --xsl='{file|url|id|slug}'
    --xml='{file|url|id|slug}'
    --cache='{minutes, if xsl|xml={url}}'
    --tidy='{yes|html}' or tidy or --tidy='xml'
    --{myparam}='{myvalue}'
    --outfile='{filepath}'
    --htmlentities='yes' or htmlentities

$ wp xslt transform_xml --xsl='sample-xsl' --xml='sample-xml' --testparam='HERE' > ./cli-outfile.txt


wp xslt select_xml
    --xml='{file|url|id|slug}'
    --cache='{minutes, if xml={url}}'
    --select='{xpath}'
    --root='{nodename|empty}'
    --tidy='{yes|html}' or tidy or --tidy='xml'
    --strip-namespaces='yes' or strip-namespaces
    --strip-declaration='no'
    --format='{xml|json}'
    --htmlentities='yes' or htmlentities

$ wp xslt select_xml --xml='sample-xml' --select='//list' > ./cli-outfile.txt


wp xslt select_csv
    --csv='{file|url}'
    --cache='{minutes, if csv={url}}'
    --separator=','
    --enclosure='\"'
    --escape='\\'
    --key_row='{row number for column labels}'
    --col='{return column number(s), letter(s), or label(s)}'
    --key_col='{col number, letter, or label for key matching}'
    --key='{value(s) for key_col matching}'
    --row='{return row number(s)}'
    --class='{css classname(s) for result <table>}'
    --htmlentities='yes' or htmlentities

$ wp xslt select_csv --csv="case-study-gsheets/Sheet1.csv" --row="1" --key_row="1" --key_col="ID" --key="1004,1005"