Plugin Directory

Changeset 3046647


Ignore:
Timestamp:
03/07/2024 01:07:17 AM (2 years ago)
Author:
tenandtwo
Message:

v1.0.2 - upgrade readme files and cli.php

Location:
tenandtwo-xslt-processor/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tenandtwo-xslt-processor/trunk/changelog.txt

    r3046386 r3046647  
    44
    55
    6 ## [1.0.1] - 2024-03-07
     6## [1.0.2] - 2024-03-06
     7## [1.0.1] - 2024-03-06
    78
    89### Changed
     
    1011- readme.md
    1112- readme.txt
     13- includes/cli.php : finalize transform_xml(), select_xml(), select_csv()
    1214
    1315
  • tenandtwo-xslt-processor/trunk/includes/cli.php

    r3045975 r3046647  
    3535     *     --xsl='{file|url|id|slug}'
    3636     *     --xml='{file|url|id|slug}'
    37      *     --cache={minutes, if xsl|xml={url}}
     37     *     --cache='{minutes, if xsl|xml={url}}'
    3838     *     --tidy='{yes|html}' or tidy or --tidy='xml'
    3939     *     --{myparam}='{myvalue}'
     
    4444     *
    4545     *   wp --allow-root xslt transform_xml --xsl='sample-xsl' --xml='sample-xml' --testparam='HERE' --outfile='__WP_CONTENT_DIR__/uploads/cli-outfile.txt'
     46     *   wp --allow-root xslt transform_xml --xsl='sample-xsl' --xml='sample-xml' --testparam='HERE' > ./cli-outfile.txt
    4647     *
    4748     * @when after_wp_load
    4849     */
    49     function transform_xml( $args, $assoc_args ) {
    50 if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
     50    public function transform_xml( $args, $assoc_args ) {
     51//if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
    5152
    5253        if (in_array('tidy',$args))             { $assoc_args['tidy'] = 'yes'; }
     
    5657        $content = $assoc_args['content'] ?? '';
    5758        $result  = XSLT_Processor_Shortcode::xslt_transform_xml( $attrs, $content );
     59if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('attrs','content','result'),true), E_USER_NOTICE); }
    5860
    59         WP_CLI::success('');
    60         if (WP_DEBUG) { WP_CLI::line( __METHOD__.' : '.print_r($attrs,true) ); }
    6161        WP_CLI::line( print_r($result,true) );
    6262    }
     
    7070     *   wp xslt select_xml
    7171     *     --xml='{file|url|id|slug}'
    72      *     --cache={minutes, if xml={url}}
     72     *     --cache='{minutes, if xml={url}}'
    7373     *     --select='{xpath}'
    7474     *     --root='{nodename|empty}'
    7575     *
    76      *     --tidy=yes|html or tidy or --tidy=xml
    77      *     --strip-namespaces=yes or strip-namespaces
    78      *     --strip-declaration=yes|no
     76     *     --tidy='{yes|html}' or tidy or --tidy='xml'
     77     *     --strip-namespaces='{no|yes}' or strip-namespaces
     78     *     --strip-declaration='{yes|no}'
    7979     *
    8080     *     --format='{xml|json}'
    81      *     --htmlentities=yes or htmlentities
     81     *     --htmlentities='yes' or htmlentities
    8282     *
    8383     * ## EXAMPLES
    8484     *
    8585     *   wp --allow-root xslt select_xml --xml='sample-xml' --select='//list'
     86     *   wp --allow-root xslt select_xml --xml='sample-xml' --select='//list' > ./cli-outfile.txt
    8687     *
    8788     * @when after_wp_load
    8889     */
    89     function select_xml( $args, $assoc_args ) {
    90 if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
     90    public function select_xml( $args, $assoc_args ) {
     91//if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
    9192
    9293        if (in_array('strip-namespaces',$args)) { $assoc_args['strip-namespaces'] = 'yes'; }
     
    9798        $content = $assoc_args['content'] ?? '';
    9899        $result  = XSLT_Processor_Shortcode::xslt_select_xml( $attrs, $content );
     100if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('attrs','content','result'),true), E_USER_NOTICE); }
    99101
    100         WP_CLI::success('');
    101         if (WP_DEBUG) { WP_CLI::line( __METHOD__.' : '.print_r($attrs,true) ); }
    102102        WP_CLI::line( print_r($result,true) );
    103103    }
     
    111111     *   wp xslt select_csv
    112112     *     --csv='{file|url}'
    113      *     --cache={minutes, if csv={url}}
     113     *     --cache='{minutes, if csv={url}}'
    114114     *
    115      *     --separator=","
    116      *     --enclosure="\""
    117      *     --escape="\\"
     115     *     --separator=','
     116     *     --enclosure='\"'
     117     *     --escape='\\'
    118118     *
    119      *     --key_row="{row number for column labels}"
    120      *     --col="{return column number(s), letter(s), or label(s)}"
    121      *     --key_col="{col number, letter, or label for key matching}"
    122      *     --key="{value(s) for key_col matching}"
    123      *     --row="{return row number(s)}"
    124      *     --class="{css classname(s) for result <table>}"
     119     *     --key_row='{row number for column labels}'
     120     *     --col='{return column number(s), letter(s), or label(s)}'
     121     *     --key_col='{col number, letter, or label for key matching}'
     122     *     --key='{value(s) for key_col matching}'
     123     *     --row='{return row number(s)}'
     124     *     --class='{css classname(s) for result <table>}'
    125125     *
    126      *     --htmlentities=yes or htmlentities
     126     *     --htmlentities='yes' or htmlentities
    127127     *
    128128     * ## EXAMPLES
     
    130130     *   wp --allow-root xslt select_csv --csv='case-study-gsheets/Sheet1.csv'
    131131     *   wp --allow-root xslt select_csv --csv="case-study-gsheets/Sheet1.csv" --row="1" --key_row="1" --key_col="ID" --key="1004,1005"
     132     *   wp --allow-root xslt transform_xml --xsl='csv-pivot-xsl' --key_row='1' --content='[xslt_select_csv csv="case-study-gsheets/Sheet1.csv" row="1" key_row="1" key_col="ID" key="1004,1005" /]'
    132133     *
    133      *   wp --allow-root xslt transform_xml --xsl='csv-pivot-xsl' --key_row='1' --content='[xslt_select_csv csv="case-study-gsheets/Sheet1.csv" row="1" key_row="1" key_col="ID" key="1004,1005" /]'     *
    134134     * @when after_wp_load
    135135     */
    136     function select_csv( $args, $assoc_args ) {
    137 if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
     136    public function select_csv( $args, $assoc_args ) {
     137//if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('args','assoc_args'),true), E_USER_NOTICE); }
    138138
    139139        if (in_array('htmlentities',$args))     { $assoc_args['htmlentities'] = 'yes'; }
     
    142142        $content = $assoc_args['content'] ?? '';
    143143        $result  = XSLT_Processor_Shortcode::xslt_select_csv( $attrs, $content );
     144if (WP_DEBUG) { trigger_error(__METHOD__." : ".print_r(compact('attrs','content','result'),true), E_USER_NOTICE); }
    144145
    145         WP_CLI::success('');
    146         if (WP_DEBUG) { WP_CLI::line( __METHOD__.' : '.print_r($attrs,true) ); }
    147146        WP_CLI::line( print_r($result,true) );
    148147    }
     
    150149
    151150} // end class XSLT_Processor_CLI
    152 
    153 
    154 
    155     /**
    156      * ## OPTIONS
    157      *
    158      * [--xsl=<xsl>]
    159      * : xsl stylesheet
    160      * ---
    161      * default: default.xsl
    162      * ---
    163      *
    164      * [--xml=<xml>]
    165      * : xml document
    166      * ---
    167      * default: default.xml
    168      * ---
    169      */
  • tenandtwo-xslt-processor/trunk/readme.md

    r3046386 r3046647  
    77**Tested up to:** 6.4 
    88**Requires PHP:** 7.4 
    9 **Stable tag:** 1.0.1 
     9**Stable tag:** 1.0.2 
    1010**License:** GPLv2 or later 
    1111**License URI:** https://www.gnu.org/licenses/gpl-2.0.html 
     
    1919## Description
    2020
    21 The Ten&Two XSLT Processor plugin brings the power of PHP's [XSL extension](https://www.php.net/manual/en/book.xsl.php) to Wordpress.  Once enabled, the plugin creates three (3) shortcodes - **`[xslt_transform/]`**, **`[xslt_select_xml/]`**, **`[xslt_select_csv/]`** - which can be used separately or in tandem to enrich your site with content from XML and CSV sources.  The plugin also enables two custom post types - **`XSL Stylesheets`** and **`XML Documents`** - for managing and validating sources within WP Admin.
     21The Ten&Two XSLT Processor plugin brings the power of PHP's [XSL extension](https://www.php.net/manual/en/book.xsl.php) to Wordpress.  Once enabled, the plugin creates three (3) shortcodes - **`[xslt_transform_xml/]`**, **`[xslt_select_xml/]`**, and **`[xslt_select_csv/]`** - which can be used separately or in tandem to enrich your site with content from XML and CSV sources.  The plugin also enables two (2) custom post types - **`XSL Stylesheets`** and **`XML Documents`** - for managing and validating sources within WP Admin.
    2222
    2323Detailed documentation and sample code can be found at [https://xsltproc.tenandtwo.com/](https://xsltproc.tenandtwo.com/)
     
    2929
    3030
    31 ### Shortcode : `[xslt_transform/]`
    32 
    33 `[xslt_transform/]` is the plugin's primary function.  This shortcode processes XML data using an XSL stylesheet, and then outputs the result as HTML, more XML, or as simple TEXT.
    34 
    35  - **`[xslt_transform xsl="{file|url|id|slug}" xml="{file|url|id|slug}" /]`**
    36  - **`[xslt_transform xsl="{file|url|id|slug}"]<DATA>...</DATA>[/xslt_transform]`**
     31### Shortcode : `[xslt_transform_xml/]`
     32
     33`[xslt_transform_xml/]` is the plugin's primary function.  This shortcode processes XML data using an XSL stylesheet, and then outputs the result as HTML, more XML, or as simple TEXT.
     34
     35 - **`[xslt_transform_xml xsl="{file|url|id|slug}" xml="{file|url|id|slug}" /]`**
     36 - **`[xslt_transform_xml xsl="{file|url|id|slug}"]<DATA>...</DATA>[/xslt_transform_xml]`**
    3737
    3838If either the `xsl` or `xml` parameter is left unspecified, defaults are used.  The default XML value is `<NODATA/>`.  The default XSL stylesheet prints all of the incoming data as HTML.  If extra attributes are specified in the shortcode - eg, `mykey="myval"` - those keys/values are passed along as parameters to the stylesheet - `<xsl:param name="mykey"/>`.
     
    4141### Shortcode : `[xslt_select_xml/]`
    4242
    43 `[xslt_select_xml/]` is a helper function.  It reads XML and returns a selection of the data, based on a supplied XPath expression.  There are two options for specifying the XPath.  First, using the `select` attribute or, second, using the body of the shortcode.  Complex select statements with quotes, square brackets or other special syntax, should use the second pattern :
     43`[xslt_select_xml/]` is a helper function.  It reads XML and returns a selection of the data, based on a supplied XPath expression.  There are two (2) options for specifying the XPath.  First, using the `select` attribute or, second, using the body of the shortcode.  Complex select statements with quotes, square brackets or other special syntax, should use the second pattern :
    4444
    4545 - **`[xslt_select_xml xml="{file|url|id|slug}" select="{XPath}" /]`**
     
    5151### Shortcode : `[xslt_select_csv/]`
    5252
    53 `[xslt_select_csv/]` is a helper function for converting CSV file data to XML.  The result can be output directly as an HTML `<table>`, or the result can be passed to `[xslt_transform/]` for further processing.
     53`[xslt_select_csv/]` is a helper function for converting CSV file data to XML.  The result can be output directly as an HTML `<table>`, or the result can be passed to `[xslt_transform_xml/]` for further processing.
    5454
    5555 - **`[xslt_select_csv csv="{file|url}" /]`**
     
    7272### Nested Shortcodes
    7373
    74 Combine `[xslt_transform]` with `[xslt_select_xml]` :
    75 
    76  - **`[xslt_transform][xslt_select_xml/][/xslt_transform]`**
    77 
    78 Combine `[xslt_transform]` with `[xslt_select_csv]` :
    79 
    80  - **`[xslt_transform][xslt_select_csv/][/xslt_transform]`**
    81 
    82 Combine `[xslt_transform]` with itself using `[/xslt_transform_alias]` (WP does not support nested shortcodes with identical names) :
    83 
    84  - **`[xslt_transform_alias][xslt_transform/][/xslt_transform_alias]`**
     74Combine `[xslt_transform_xml]` with `[xslt_select_xml]` :
     75
     76 - **`[xslt_transform_xml][xslt_select_xml/][/xslt_transform_xml]`**
     77
     78Combine `[xslt_transform_xml]` with `[xslt_select_csv]` :
     79
     80 - **`[xslt_transform_xml][xslt_select_csv/][/xslt_transform_xml]`**
     81
     82Combine `[xslt_transform_xml]` with itself using `[/xslt_transform_alias]` (WP does not support nested shortcodes with identical names) :
     83
     84 - **`[xslt_transform_alias][xslt_transform_xml/][/xslt_transform_alias]`**
    8585
    8686Combine multiple shortcodes/sources to create a single `XML Document` (see Custom Post Types above) :
     
    9393When a shortcode specifies a remote file - `xml="{url}"` or `csv="{url}"` - that source is cached locally using WP Transients. The default cache duration is set in the XSLT Processor Settings.  To override the default, add `cache="{minutes}"` to the shortcode.
    9494
    95  - **`[xslt_transform xml="{url}" cache="{minutes}" /]`**
     95 - **`[xslt_transform_xml xml="{url}" cache="{minutes}" /]`**
    9696 - **`[xslt_select_xml xml="{url}" cache="{minutes}" /]`**
    9797 - **`[xslt_select_csv csv="{url}" cache="{minutes}" /]`**
     
    100100### Namespace Parameters
    101101
    102 Within `[xslt_select_xml/]` the plugin provides two methods for handling XML containing namespaces.  The first is to add `strip-namespaces` to the shortcode.  The second method is to add the needed prefixes and namespace URIs using `xslns`.
     102Within `[xslt_select_xml/]` the plugin provides two (2) methods for handling XML containing namespaces.  The first is to add `strip-namespaces` to the shortcode.  The second method is to add the needed prefixes and namespace URIs using `xslns`.
    103103
    104104 - **`[xslt_select_xml xml="{file}" strip-namespaces="yes" select="//node" /]`**
    105105 - **`[xslt_select_xml xml="{file}" xmlns="ns1" ns1="{namespace-uri-1}" select="//ns1:node" /]`**
    106106 - **`[xslt_select_xml xml="{file}" xmlns="ns1 ns2" ns1="{namespace-uri-1}" ns2="{namespace-uri-2}" select="//ns1:node/ns2:node" /]`**
     107
     108
     109### WP-CLI
     110
     111All three (3) shortcodes have command-line equivalents. They can be used, for instance, to run quick tests. Or they can be used, by piping the outputs into files, to pre-generate results.
     112
     113 *      wp xslt transform_xml
     114            --xsl='{file|url|id|slug}'
     115            --xml='{file|url|id|slug}'
     116            --cache='{minutes, if xsl|xml={url}}'
     117            --tidy='{yes|html}' or tidy or --tidy='xml'
     118            --{myparam}='{myvalue}'
     119            --outfile='{filepath}'
     120            --htmlentities='yes' or htmlentities
     121
     122 *      wp xslt select_xml
     123            --xml='{file|url|id|slug}'
     124            --cache='{minutes, if xml={url}}'
     125            --select='{xpath}'
     126            --root='{nodename|empty}'
     127            --tidy='{yes|html}' or tidy or --tidy='xml'
     128            --strip-namespaces='yes' or strip-namespaces
     129            --strip-declaration='no'
     130            --format='{xml|json}'
     131            --htmlentities='yes' or htmlentities
     132
     133 *      wp xslt select_csv
     134            --csv='{file|url}'
     135            --cache='{minutes, if csv={url}}'
     136            --separator=','
     137            --enclosure='\"'
     138            --escape='\\'
     139            --key_row='{row number for column labels}'
     140            --col='{return column number(s), letter(s), or label(s)}'
     141            --key_col='{col number, letter, or label for key matching}'
     142            --key='{value(s) for key_col matching}'
     143            --row='{return row number(s)}'
     144            --class='{css classname(s) for result <table>}'
     145            --htmlentities='yes' or htmlentities
    107146
    108147
     
    157196## Frequently Asked Questions
    158197
     198- - -
     199
    159200### Where are the plugin options?
    160201
     
    166207 - **Local File Search Paths**
    167208
     209- - -
    168210
    169211### Where is the documentation?
     
    178220 - [How To](https://xsltproc.tenandtwo.com/xslt-processor/how-to)
    179221
     222- - -
  • tenandtwo-xslt-processor/trunk/readme.txt

    r3046406 r3046647  
    66Tested up to: 6.4
    77Requires PHP: 7.4
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1616== Description ==
    1717
    18 The Ten&Two XSLT Processor plugin brings the power of PHP's XSL extension to Wordpress.  Once enabled, the plugin creates three (3) shortcodes - `[xslt_transform/]`, `[xslt_select_xml/]`, and `[xslt_select_csv/]` - which can be used separately or in tandem to enrich your site with content from XML and CSV sources.  The plugin also enables two custom post types - `XSL Stylesheets` and `XML Documents` - for managing and validating sources within WP Admin.
     18The Ten&Two XSLT Processor plugin brings the power of PHP's XSL extension to Wordpress.  Once enabled, the plugin creates three (3) shortcodes - `[xslt_transform_xml/]`, `[xslt_select_xml/]`, and `[xslt_select_csv/]` - which can be used separately or in tandem to enrich your site with content from XML and CSV sources.  The plugin also enables two (2) custom post types - `XSL Stylesheets` and `XML Documents` - for managing and validating sources within WP Admin.
    1919
    2020Detailed documentation and sample code can be found at https://xsltproc.tenandtwo.com/
     
    2626
    2727
    28 = Shortcode : [xslt_transform/] =
    29 
    30 [xslt_transform/] is the plugin's primary function.  This shortcode processes XML data using an XSL stylesheet, and then outputs the result as HTML, more XML, or as simple TEXT.
    31 
    32  - `[xslt_transform xsl="{file|url|id|slug}" xml="{file|url|id|slug}" /]`
    33  - `[xslt_transform xsl="{file|url|id|slug}"]<DATA>...</DATA>[/xslt_transform]`
     28= Shortcode : [xslt_transform_xml/] =
     29
     30[xslt_transform_xml/] is the plugin's primary function.  This shortcode processes XML data using an XSL stylesheet, and then outputs the result as HTML, more XML, or as simple TEXT.
     31
     32 - `[xslt_transform_xml xsl="{file|url|id|slug}" xml="{file|url|id|slug}" /]`
     33 - `[xslt_transform_xml xsl="{file|url|id|slug}"]<DATA>...</DATA>[/xslt_transform_xml]`
    3434
    3535If either the `xsl` or `xml` parameter is left unspecified, defaults are used.  The default XML value is `<NODATA/>`.  The default XSL stylesheet prints all of the incoming data as HTML.  If extra attributes are specified in the shortcode - eg, `mykey="myval"` - those keys/values are passed along as parameters to the stylesheet - `<xsl:param name="mykey"/>`.
     
    3838= Shortcode : [xslt_select_xml/] =
    3939
    40 [xslt_select_xml/] is a helper function.  It reads XML and returns a selection of the data, based on a supplied XPath expression.  There are two options for specifying the XPath.  First, using the `select` attribute or, second, using the body of the shortcode.  Complex select statements with quotes, square brackets or other special syntax, should use the second pattern :
     40[xslt_select_xml/] is a helper function.  It reads XML and returns a selection of the data, based on a supplied XPath expression.  There are two (2) options for specifying the XPath.  First, using the `select` attribute or, second, using the body of the shortcode.  Complex select statements with quotes, square brackets or other special syntax, should use the second pattern :
    4141
    4242 - `[xslt_select_xml xml="{file|url|id|slug}" select="{XPath}" /]`
     
    4848= Shortcode : [xslt_select_csv/] =
    4949
    50 [xslt_select_csv/] is a helper function for converting CSV file data to XML.  The result can be output directly as an HTML `<table>`, or the result can be passed to `[xslt_transform/]` for further processing.
     50[xslt_select_csv/] is a helper function for converting CSV file data to XML.  The result can be output directly as an HTML `<table>`, or the result can be passed to `[xslt_transform_xml/]` for further processing.
    5151
    5252 - `[xslt_select_csv csv="{file|url}" /]`
     
    6969= Nested Shortcodes =
    7070
    71 Combine `[xslt_transform]` with `[xslt_select_xml]` :
    72 
    73  - `[xslt_transform][xslt_select_xml/][/xslt_transform]`
    74 
    75 Combine `[xslt_transform]` with `[xslt_select_csv]` :
    76 
    77  - `[xslt_transform][xslt_select_csv/][/xslt_transform]`
    78 
    79 Combine `[xslt_transform]` with itself using `[/xslt_transform_alias]` (WP does not support nested shortcodes with identical names) :
    80 
    81  - `[xslt_transform_alias][xslt_transform/][/xslt_transform_alias]`
     71Combine `[xslt_transform_xml]` with `[xslt_select_xml]` :
     72
     73 - `[xslt_transform_xml][xslt_select_xml/][/xslt_transform_xml]`
     74
     75Combine `[xslt_transform_xml]` with `[xslt_select_csv]` :
     76
     77 - `[xslt_transform_xml][xslt_select_csv/][/xslt_transform_xml]`
     78
     79Combine `[xslt_transform_xml]` with itself using `[/xslt_transform_alias]` (WP does not support nested shortcodes with identical names) :
     80
     81 - `[xslt_transform_alias][xslt_transform_xml/][/xslt_transform_alias]`
    8282
    8383Combine multiple shortcodes/sources to create a single `XML Document` (see Custom Post Types above) :
     
    9090When a shortcode specifies a remote file - `xml="{url}"` or `csv="{url}"` - that source is cached locally using WP Transients. The default cache duration is set in the XSLT Processor Settings.  To override the default, add `cache="{minutes}"` to the shortcode.
    9191
    92  - `[xslt_transform xml="{url}" cache="{minutes}" /]`
     92 - `[xslt_transform_xml xml="{url}" cache="{minutes}" /]`
    9393 - `[xslt_select_xml xml="{url}" cache="{minutes}" /]`
    9494 - `[xslt_select_csv csv="{url}" cache="{minutes}" /]`
     
    9797= Namespace Parameters =
    9898
    99 Within `[xslt_select_xml/]` the plugin provides two methods for handling XML containing namespaces.  The first is to add `strip-namespaces` to the shortcode.  The second method is to add the needed prefixes and namespace URIs using `xslns`.
     99Within `[xslt_select_xml/]` the plugin provides two (2) methods for handling XML containing namespaces.  The first is to add `strip-namespaces` to the shortcode.  The second method is to add the needed prefixes and namespace URIs using `xslns`.
    100100
    101101 - `[xslt_select_xml xml="{file}" strip-namespaces="yes" select="//node" /]`
    102102 - `[xslt_select_xml xml="{file}" xmlns="ns1" ns1="{namespace-uri-1}" select="//ns1:node" /]`
    103103 - `[xslt_select_xml xml="{file}" xmlns="ns1 ns2" ns1="{namespace-uri-1}" ns2="{namespace-uri-2}" select="//ns1:node/ns2:node" /]`
     104
     105
     106= WP-CLI =
     107
     108All three (3) shortcodes have command-line equivalents. They can be used, for instance, to run quick tests. Or they can be used, by piping the outputs into files, to pre-generate results.
     109
     110 *      wp xslt transform_xml
     111            --xsl='{file|url|id|slug}'
     112            --xml='{file|url|id|slug}'
     113            --cache='{minutes, if xsl|xml={url}}'
     114            --tidy='{yes|html}' or tidy or --tidy='xml'
     115            --{myparam}='{myvalue}'
     116            --outfile='{filepath}'
     117            --htmlentities='yes' or htmlentities
     118
     119 *      wp xslt select_xml
     120            --xml='{file|url|id|slug}'
     121            --cache='{minutes, if xml={url}}'
     122            --select='{xpath}'
     123            --root='{nodename|empty}'
     124            --tidy='{yes|html}' or tidy or --tidy='xml'
     125            --strip-namespaces='yes' or strip-namespaces
     126            --strip-declaration='no'
     127            --format='{xml|json}'
     128            --htmlentities='yes' or htmlentities
     129
     130 *      wp xslt select_csv
     131            --csv='{file|url}'
     132            --cache='{minutes, if csv={url}}'
     133            --separator=','
     134            --enclosure='\"'
     135            --escape='\\'
     136            --key_row='{row number for column labels}'
     137            --col='{return column number(s), letter(s), or label(s)}'
     138            --key_col='{col number, letter, or label for key matching}'
     139            --key='{value(s) for key_col matching}'
     140            --row='{return row number(s)}'
     141            --class='{css classname(s) for result <table>}'
     142            --htmlentities='yes' or htmlentities
    104143
    105144
     
    154193== Frequently Asked Questions ==
    155194
     195- - -
     196
    156197= Where are the plugin options? =
    157198
     
    163204 - Local File Search Paths
    164205
     206- - -
    165207
    166208= Where is the documentation? =
     
    175217 - How To          : https://xsltproc.tenandtwo.com/xslt-processor/how-to
    176218
     219- - -
    177220
    178221== Screenshots ==
     
    183226== Changelog ==
    184227
    185 = 1.0.1 =
    186 * Update readme files
    187 
    188 = 1.0.0 =
     228= 1.0.x =
    189229* Initial Release
     230* Add WP-CLI commands
  • tenandtwo-xslt-processor/trunk/tenandtwo-xslt-processor.php

    r3046386 r3046647  
    1313 * Plugin URI:        https://wordpress.org/plugins/tenandtwo-xslt-processor/
    1414 * Description:       Transform and display XML from local and remote sources using PHP's XSL extension.
    15  * Version:           1.0.1
     15 * Version:           1.0.2
    1616 * Requires PHP:      7.4
    1717 * Requires at least: 5.2
Note: See TracChangeset for help on using the changeset viewer.