| | # Overview |
| | |
| | -Relational XPath Map (**rxm**) is a simple, terse database query language |
| | -that produces structured documents. |
| | +Relational XPath Map (**rxm**) is a terse database query language to |
| | +produce structured documents. |
| | |
| | The syntax examples show how to produce an XML document, but the same |
| | -mapping could produce any structured format (e.g., JSON, YAML, or TOML). |
| | +mapping could produce any structured format, including JSON. |
| | |
| | # Syntax |
 |
| | |
| | ``` |
| | -root > people, # "root" keyword starts the document |
| | -person > person, # maps a node to table context |
| | -.first_name > first, # maps a node to column |
| | -.last_name > name/last, # maps an ancestor node to a column |
| | -.age > @age, # @ maps an attribute to table node |
| | -account.person_id > person.person_id, # performs an inner join |
| | -account > account, # context is now "account" node |
| | -.id > @id, |
| | -^, # pop stack to previous context |
| | -address > address, |
| | -.*; # * globs all columns. ; is WHERE |
| | +root > people, # "root" keyword starts the document |
| | +person > person, # maps a node to table context |
| | +.first_name > first, # maps a node to column |
| | +.last_name > name/last, # maps an ancestor node to a column |
| | +.age > @age, # @ maps an attribute to table node |
| | +account.person_id > person.person_id, # performs an inner join |
| | +account > account, # context is now "account" node |
| | +.id > @id, # account id attribute |
| | +^, # pop stack to previous context |
| | +address > address # switch context to "address" node |
| | +.*; # * globs all columns. ; is WHERE |
| | ``` |
| | |
 |
| | ``` |
| | |
| | -Note: Multiple stack pops (`^`) are allowed per line. If a pop would otherwise |
| | +Note: Multiple stack pops (`^`) are allowed per line; if a pop would otherwise |
| | exceed the root context, the context remains at the root. |
| | |