-- $Date: 2004/01/28 05:01:41 $
-- $Revision: 1.7 $
-- $Author: jcrocholl $

package body Works.MusicXML is

   -- Read work data from an XML reader.
   function Read_Work
     (XML : access XML_Reader-- Use this XML reader.
     return Work_Access        -- The newly created work.
   is
      Work_Number : String := Read_Element_Data(XML, "work-number");
      Work_Title  : String := Read_Element_Data(XML, "work-title");
   begin
      return Create(Work_Number, Work_Title);
   end Read_Work;

   -- Write work data to an XML writer.
   procedure Write_Work
     (XML  : access XML_Writer-- Use this XML writer.
      This : access Work)       -- Write this work.
   is
   begin
      Start_Element(XML, "work");

      if Get_Number(This) /= "" then
         Write_Element(XML, "work-number", Get_Number(This));
      end if;

      if Get_Title(This) /= "" then
         Write_Element(XML, "work-title", Get_Title(This));
      end if;

      Close_Element(XML, "work");
   end Write_Work;

end Works.MusicXML;