| | person > person, # maps table context to a node |
| | .age > @age, # @ maps a column to an attribute node |
| | -.first_name > first, # maps a column to a node |
| | -.last_name > name/last, # maps a column to a descendant node |
| | +.first_name > name/first, # maps a column to a node |
| | +.last_name > .../last, # ... reuses the previous node's path |
| | 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 table context |
| | address > address, # switch context to "address" node |
| | .*, # glob remaining columns |
| | ; # Denotes optional WHERE clause |
| | ``` |
| | |
| | -The above mapping would generate: |
| | +The example mapping produces: |
| | |
| | ``` |
| | <people> |
| | <person age="42"> |
| | - <first>Charles</first> |
| | <name> |
| | + <first>Charles</first> |
| | <last>Goldfarb</last> |
| | </name> |
| | <account id="123"/> |
| | <address> |
| | + <id>456</id> |
| | <street>123 Query Lane</street> |
| | <city>San Francisco</city> |
| | </address> |
| | </person> |
| | </people> |
| | ``` |
| | |
| | -Although XML document is shown, any structured document format is possible, |
| | -including JSON. This can be accomplished either through XSLT or implementing |
| | -a document-specific interface definition. |
| | +Any structured document format can be produced, including JSON. |
| | |
| | ### Pops |