You are here: MusicXML Reference > Score Schema (XSD) > Elements > Element: link

Element: link

Description

The link type serves as an outgoing simple XLink. It is also used to connect a MusicXML score with a MusicXML opus. If a relative link is used within a document that is part of a compressed MusicXML file, the link is relative to the root folder of the zip file.

Derived By

Type link

Attributes
Name  Type  Required?  Default  Description 
xlink:href  xs:anyURI  No 
xlink:type  xs:NMTOKEN (restriction)  No 
xlink:role  xs:token  No 
xlink:title  xs:token  No 
xlink:show  xs:NMTOKEN (restriction)  No 
xlink:actuate  xs:NMTOKEN (restriction)  No 
name  xs:token  No 
element  xs:NMTOKEN  No 
position  xs:positiveInteger  No 
default-x  tenths  No 
default-y  tenths  No 
relative-x  tenths  No 
relative-y  tenths  No 
Content Model

Always empty.

Referenced By
Example

Figure 1

Figure 2

The individual MusicXML score files contain hyperlinks within the score indicating the connections between them. Example 1 shows the connection stored in the first variant. The id names reflect that there are no slurs in the top staff of the first variant, while slurs are present in the top staff of the second variant.

Example 1: Representing a link from the first variant to the second variant

      <bookmark id="Bar2NoSlurs"/>
      <link xlink:href="bach_2.xml#Bar2Slurs"/>

Example 2: Representing a link from the second variant to the first variant

      <bookmark id="Bar2Slurs"/>
      <link xlink:href="bach_1.xml#Bar2NoSlurs"/>

Each variant is represented by a separate MusicXML score-partwise document. The first variant is called bach_1.xml and the second is called bach_2.xml. Each of these files is then placed in the bach_1.mxl compressed zip file. A compressed MusicXML zip file always has a file at META-INF/container.xml whose first rootfile element points to the primary music notation file. Example 4 shows the content of the container.xml file in this example, where the first variant is considered the primary file.

Each variant is represented by a separate MusicXML score-partwise document. The first variant is called bach_1.xml and the second is called bach_2.xml. Each of these files is then placed in the bach_1.mxl compressed zip file. A compressed MusicXML zip file always has a file at META-INF/container.xml whose first rootfile element points to the primary music notation file. Example 4 shows the content of the container.xml file in this example, where the first variant is considered the primary file.

Example 4: Contents of the container.xml file within the bach_1.mxl file

<?xml version="1.0" encoding="UTF-8"?>
<container>
  <rootfiles>
    <rootfile full-path="bach_1.xml"/>
  </rootfiles>
</container>

Since these compressed files are zip-based, similar to the techniques used for many other XML-based formats in other domains such as word processing, they can be directly edited by industry-standard XML editors. The figure below shows what the bach_1.mxl file looks like when opened by the XMLSpy editor.

Opening the bach_1.mxl file in the XMLSpy editor


 

MusicXML Documentation Home
Last built 2/20/2015

7007 Winchester Circle, Suite 140

Boulder, CO 80301