<!--
	MusicXML link.dtd

	Version 1.0 - 13 January 2004
	
	Copyright © 2004 Recordare LLC.
	http://www.recordare.com/
	
	This MusicXML work is being provided by the copyright
	holder under the MusicXML Document Type Definition 
	Public License Version 1.02, available from:
	
		http://www.recordare.com/dtds/license.html
-->

<!--
	This DTD describes the entity and elements used for
	simple XLink support. The link element serves as an
	outgoing XLink. The bookmark element serves as a well-
	defined target for an incoming XLink. The entity for
	link-attributes is also used to connect a MusicXML
	score with a MusicXML opus.
-->

<!-- Entities -->

<!--
	Namespace entity for the XLink recommendation.
-->
<!ENTITY % xlink.ns "http://www.w3.org/1999/xlink">

<!--
	The link-attributes entity includes all the
	simple XLink attributes supported in MusicXML.
-->
<!ENTITY % link-attributes
	"xmlns:xlink  CDATA    #FIXED     '%xlink.ns;'
	 xlink:href   CDATA    #REQUIRED
	 xlink:type   (simple) #FIXED     'simple'
	 xlink:role   CDATA    #IMPLIED
	 xlink:title  CDATA    #IMPLIED
	 xlink:show   (new | replace | embed | other | none)
		'replace'
	 xlink:actuate	(onRequest | onLoad | other | none)
		'onRequest'">

<!-- Elements -->

<!ELEMENT link EMPTY>
<!ATTLIST link
    %link-attributes;
    name  CDATA  #IMPLIED
>
	
<!ELEMENT bookmark EMPTY>
<!ATTLIST bookmark
    id    ID     #REQUIRED
    name  CDATA  #IMPLIED
>

<SCRIPT language="Javascript">
<!--

// FILE ARCHIVED ON 20040916010541 AND RETRIEVED FROM THE
// INTERNET ARCHIVE ON 20070826202154.
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
// SECTION 108(a)(3)).

   var sWayBackCGI = "http://web.archive.org/web/20040916010541/";

   function xResolveUrl(url) {
      var image = new Image();
      image.src = url;
      return image.src;
   }
   function xLateUrl(aCollection, sProp) {
      var i = 0;
      for(i = 0; i < aCollection.length; i++) {
         if (typeof(aCollection[i][sProp]) == "string") { 
          if (aCollection[i][sProp].indexOf("mailto:") == -1 &&
             aCollection[i][sProp].indexOf("javascript:") == -1) {
            if(aCollection[i][sProp].indexOf("http") == 0) {
                aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp];
            } else {
                aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]);
            }
         }
         }
      }
   }

   xLateUrl(document.getElementsByTagName("IMG"),"src");
   xLateUrl(document.getElementsByTagName("A"),"href");
   xLateUrl(document.getElementsByTagName("AREA"),"href");
   xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
   xLateUrl(document.getElementsByTagName("OBJECT"),"data");
   xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
   xLateUrl(document.getElementsByTagName("APPLET"),"archive");
   xLateUrl(document.getElementsByTagName("EMBED"),"src");
   xLateUrl(document.getElementsByTagName("BODY"),"background");
   var forms = document.getElementsByTagName("FORM");
   if (forms) {
       var j = 0;
       for (j = 0; j < forms.length; j++) {
              f = forms[j];
              if (typeof(f.action)  == "string") {
                 if(typeof(f.method)  == "string") {
                     if(typeof(f.method) != "post") {
                        f.action = sWayBackCGI + f.action;
                     }
                  }
              }
        }
    }


//-->
</SCRIPT>

