-- $Date: 2004/02/14 06:25:02 $
-- $Revision: 1.4 $
-- $Author: jcrocholl $

with Token_Readers; use Token_Readers;

package body Score_Instruments.MusicXML is

   -- Read score instrument data from an XML reader.
   function Read_Score_Instrument
     (XML : access XML_Reader)         -- Use this XML reader.
     return Score_Instrument_Access is -- The newly created score instrument.
   begin
      Assert_Attribute_Name(XML, "id");
      Read_Attribute_Value(XML);
      Exit_Tag(XML);
      return Create(Get_Token(XML), Read_Element_Data(XML, "instrument-name"));
   end Read_Score_Instrument;

   -- Write score instrument data to an XML writer.
   procedure Write_Score_Instrument
     (XML  : access XML_Writer;       -- Use this XML writer.
      This : access Score_Instrument-- Write this score instrument.
   is
   begin
      Start_Element(XML, "score-instrument", "id", Get_ID(This));
      Write_Element(XML, "instrument-name", Get_Name(This));
      Close_Element(XML, "score-instrument");
   end Write_Score_Instrument;

end Score_Instruments.MusicXML;