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>
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy