XML from Data Base Examples
SX-E-9 Making an XML element with the entity objects as parameters
XML element with the entity objects as parameters
Example 9
This example creates an 'FullAddress' element with
- four attributes, three of them ('PostalCode', 'Address', 'City') are produced by XMLATTRIBUTES, and the fourth attribute - 'country' is calculated by xquery_eval
- 'Region' subelement, that is produced by xtree_doc
- text content, that is produced by xpath_eval
- 'emp' subelement with text content from the column "LastName", that is created by nested XMLELEMENT
select XMLELEMENT ('FullAddress',
XMLATTRIBUTES ( "PostalCode", "Address", "City"),
xtree_doc ('<Region>WA</Region>'),
xquery_eval('//@country', xtree_doc('<a country="USA"/>')),
xpath_eval('//@Phone', xtree_doc('<a Phone="(206) 555-9857"/>')),
XMLELEMENT('emp', "LastName"))
from "Demo"."demo"."Employees"
| View the source | Action |
|---|---|
| 1. sx_e_9_sample.vsp | Run |
OpenLink Home
Technical Support