Background
A table (equipment_group [eg]) includes various equipment categories:
bakeware
cookware
kitchenware
utensils
Problem
The values must be encoded XML elements, such as:
xmlelement( name eg.label )
Each element can have multiple objects, as shown in the following XML snippet:
<equipment>
<bakeware>
<object min-quantity="20">ramekin</object>
<object alias="pan">shallow baking pan</object>
</bakeware>
<cookware>
<object alias="pot">medium pot</object>
</cookware>
<utensils>
<object alias="torch">kitchen butane torch</object>
<object alias="sieve">fine-mesh sieve</object>
<object alias="whisk">wire whisk</object>
</utensils>
</equipment>
Update
At first glance, it appears as though xmlconcat can be used, however xmlconcat only allows balanced XML. That is, it does not seem possible to do the following:
xmlconcat( '<a>', '<b />', '</a>' )
This is well-formed XML, however xmlconcat raises an error:
ERROR: invalid XML content
LINE 1: select xmlconcat( '<a>', '<b/>', '</a>' );
^
DETAIL: Entity: line 1: parser error : Premature end of data in tag a line 1
Question
How would you create XML elements with names that are populated using tabular data?
Thank you!