XML Output

Top Previous Topic Next Topic  Print this topic

The Xml Output diagram object represents the structure of the XML that will be generated.

 

The following example describes an XML output which contains a list of all the employees in a corporation.  The root element, named ns:root, contains a sequence of elements named ns:emp with an attribute named id. Each ns:emp element contains a sequence of elements named ns:hist with the attributes hours-worked and department, which describe the history of the employee in the corporation.

 

 

tableds1

Output View:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ns:root xmlns:ns="http://www.tempuri.org/XML">

       <ns:emp id="1">

               <ns:hist hours-worked="300" department="Accounting"/>

               <ns:hist hours-worked="500" department="Sales"/>

               <ns:hist hours-worked="3000" department="Development"/>

               <ns:hist hours-worked="100" department="Accounting"/>

       </ns:emp>

       <ns:emp id="2">

               <ns:hist hours-worked="1000" department="Accounting"/>

               <ns:hist hours-worked="8000" department="Sales"/>

               <ns:hist hours-worked="5000" department="Development"/>

       </ns:emp>

       <ns:emp id="3"/>

</ns:root>