| | # Syntax |
| | |
| | -This section describes the **rxm** language syntax. The syntax entails: |
| | +This section describes the **rxm** syntax, which involves: |
| | |
| | * a **Map**; |
 |
| | |
| | The database entity can be a *table name*, a *column name*, or a *table and |
| | -column name*. The expression is an XPath node, an attribute, or a |
| | -*table and column name*. |
| | +column name*. The expression is a node, an attribute, or a *table and |
| | +column name*. |
| | |
| | -The above mapping could produce the following: |
| | +The above mapping produces: |
| | |
| | ``` |
 |
| | |
| | Stack pops (`^`) switch context to a previous element. Multiple pops |
| | -per line are permitted; extraneous pops are silently ignored (the context |
| | -may not traverse beyond the root). |
| | +per line are permitted; extraneous pops are silently ignored: context |
| | +never traverses beyond the root node. |
| | |
| | ### Globs |
 |
| | ### Variables |
| | |
| | -Variable parameters start with `$`. |
| | +Named parameters start with `$`. |
| | |
| | ### Logical Operators |
 |
| | |
| | # Usage |
| | + |
| | +This section describes typical usage scenarios. |
| | + |
| | +## XML Document |
| | |
| | A call to create an XML document resembles: |
| | |
| | SELECT rxm( '...mapping...' ); |
| | + |
| | +## JSON Document |
| | |
| | A call to create a JSON document resembles: |
| | |
| | SELECT rxm( '...mapping...', 'json' ); |
| | |
| | -A call with variables resembles: |
| | +## Variable Parameters |
| | |
| | - SELECT rxm( '...mapping...', 'xml', '' ); |
| | +A call to create an XML document using named variable parameters resembles: |
| | + |
| | + SELECT rxm( '...mapping...', 'xml', array_parameters ); |
| | + |
| | +The **rxm** prototype definition will vary from database to database, but |
| | +the JDBC call remains agnostic. |
| | + |
| | +### Oracle |
| | + |
| | +Using Oracle, the prototype for variable parameters might resemble: |
| | + |
| | +``` |
| | +CREATE TYPE array_parameter AS OBJECT ( |
| | + v_name VARCHAR2(255), |
| | + v_value CLOB |
| | +); |
| | + |
| | +CREATE TYPE array_parameters AS TABLE OF array_parameter; |
| | + |
| | +CREATE FUNCTION rxm ( |
| | + p_map IN CLOB, |
| | + p_format IN VARCHAR2(16), |
| | + p_parameters IN array_parameters ) ... |
| | +``` |
| | + |
| | +### PostgreSQL |
| | + |
| | +Using PostgreSQL, the prototype for variable parameters might resemble: |
| | + |
| | +``` |
| | +CREATE TYPE array_parameters AS ( |
| | + v_name VARCHAR2(255), |
| | + v_value CLOB |
| | +); |
| | + |
| | +CREATE FUNCTION rxm( |
| | + p_map CLOB, |
| | + p_format VARCHAR2(16), |
| | + p_parameters array_parameters[] ) ... |
| | +) |
| | +``` |
| | |
| | # Requirements |
 |
| | # Addendum |
| | |
| | -It might be possible to use **rxm** for data loading, as well. |
| | +It might be possible to use **rxm** for data loading. |
| | |
| | |