|
Code Listing 1: Use XMLElement to nest elements.
SELECT XMLElement("Attraction", XMLAttributes(government_owned AS GOV),
XMLElement("Name",attraction_name),
XMLElement("Location",location),
XMLElement("URL",attraction_url))
FROM attraction;
XMLELEMENT("ATTRACTION",XMLATTRIBUTES(GOV"
---------------------------------------------------------------------
<Attraction GOV="Y">
<Name>Pictured Rocks</Name>
<Location>Munising</Location>
<URL>http://www.nps.gov/piro/</URL>
</Attraction>
<Attraction GOV="N">
<Name>Da Yoopers Tourist Trap</Name>
<Location>Ishpeming</Location>
<URL>http://www.dayoopers.com/thetrap.html</URL>
</Attraction>
<Attraction GOV="N">
<Name>Valley Camp Museum Ship</Name>
<Location>Sault Ste. Marie</Location>
<URL>http://www.thevalleycamp.com/</URL>
</Attraction>
|