Commits

btingle committed 517d277

untested... but in theory this should work to fix up schema to DTD linking attributes

actuate="none" does not seem to be legal in EAD-DTD…
should be acutate="actuatenone"

http://www.loc.gov/ead/tglib/att_link.html

ACTUATE -- A control that defines whether a link occurs automatically or must be requested by the user. It is used in conjunction with the SHOW attribute to determine link behavior. Values are:
onload (element is displayed automatically)
onrequest (element is displayed if user requests)
actuateother (some other action occurs with respect to the link)
actuatenone (no action occurs with respect to the link

http://www.w3.org/TR/xlink/#link-behaviors

xlink:actuate (onLoad
|onRequest
|other
|none) #IMPLIED

None is implied if left blank; so I guess at2oac could just remove this xlink. But if at2oac already should convert onRequest to onrequest; but it won’t convert other to actuateother right now.

We have the same f’ed up ness with xlink:show to ead DTD show attribute

SHOW -- A control that defines whether a remote resource that is the target of a link appears at the point of the link, replaces the existing link, or appears in a new window. It is used in conjunction with the ACTUATE attribute to determine link behavior. Values are:
embed (the target resource displays at the point of the link)
new (the target resource appears in a new window)
replace (the target resource replaces the local resource that initiated the link)
showother (some other action takes place with respect to the target resource)
shownone (no target resource displays)

xlink:show (new
|replace
|embed
|other
|none) #IMPLIED

1) turn xlink:type to linktype
2) when converting xlink *values* to DTD values; not only lower-case them; but if the value is ‘other’ or ‘none’ concatenate the linking attribute local name to the linking attribute value

Comments (0)

Files changed (1)

   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="@xlink:actuate">
+<xsl:template match="@xlink:actuate | @xlink:show">
   <xsl:choose>
     <xsl:when test="$namespace!=''">
+      <!-- keep the @xlink: attributes if we are not nuking namespaces -->
       <xsl:copy>
         <xsl:apply-templates select="@*|node()"/>
       </xsl:copy>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:attribute name="{local-name()}">
-        <xsl:value-of select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
-      </xsl:attribute>
+      <!-- hack @xlink: attributes to be EAD 2002 DTD link attributes -->
+      <xsl:choose>
+        <xsl:when test=".='other'">
+          <xsl:value-of select="local-name()"/>
+          <xsl:text>other</xsl:text>
+        </xsl:when>
+        <xsl:when test=".='none'">
+          <xsl:value-of select="local-name()"/>
+          <xsl:text>none</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="{local-name()}">
+            <xsl:value-of select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
+          </xsl:attribute>
+        </xsl:otherwise>
+      <xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>