Each link belonging to a note (basic, text or web) is started as discrete 'link' tag. Note that aliases may have their own (intrinsic) basic links, but share text/web links (web links can only be created from $Text unless differently stored as URL-type attributes). Links use a subset of possible tag attributes
A basic link to another note:
<link name="prototype" sourceid="3176208968" sourcecreator="John Doe" sstart="-1" slen="0" style="0" arrowtype="-1" labelx="0" labely="0" linkWidth="1" destid="3197542267" destcreator="John Doe" />
A text link to a text target:
<link name="clarify" sourceid="3175851881" sourcecreator="John Doe" sstart="220" slen="13" dstart="0" dlen="12" style="0" arrowtype="-1" labelx="0" labely="0" linkWidth="1" destid="3175179052" destcreator="John Doe" />
A web link from $Text:
<link name="web reference" sourceid="3197539691" sourcecreator="John Doe" sstart="110" slen="7" style="0" arrowtype="-1" labelx="0" labely="0" linkWidth="1" destid="3162983401" destcreator="John Doe" URL="http://c-command.com/dropdmg/" target="new" />
Below are parameters in normal order of occurrence:
name. The linkType name.
sourceid. $ID of the source item.
sourcecreator. $Creator for the source object.
sstart. The zero-based character position of the start of the text anchor in the plain text $Text record, i.e. a value of 0
implies the link anchor starts from before character #1 in the $Text. A value of -1
implies this link has no anchor, such as with basic links.
slen. The length (number of characters) in the link anchor counting from the start sstart offset within the source $Text. It is always 0
for basic links.
dstart. [Optional]. Only used if there is a target anchor. The zero-based character position of the start of the destination note's text anchor in the plain text $Text record, i.e. a value of 0
implies the link anchor starts from before character #1 in the $Text.
dlen. [Optional]. Only used if there is a target anchor. The length (number of characters) in the link anchor counting from the start dStart offset within the destination $Text.
style. This is a binary value representing the various options for line style (dot, dash, broad, etc.). By observation, always '0', zero. Values are additive for options ticked: bold = 128, linear = 64, dashed = 16, dotted = 8, broad = 256. Thus dashed+broad = 272.
arrowtype. Type of arrowhead. Default is -1 and is the default arrow style. Circle is 1 and Arrow, if manually set, is 0.
labelx and labely. Default is '0', zero. If the link label is dragged from its auto-placed position. This records the X/Y offsets although the derivation of the values is undocumented. Although not always altered these attributes are always included in a link.
sourcepad and destpad. [Optional]. Only included when either/both source or destination ends of the link are dragged from their auto-positioned default. Top = 2, right = 4, bottom = 6, left = 8.
linkWidth. Always present. Value is always 1. Purpose is unknown, possibly a legacy compatibility setting.
destid. $ID of the destination object
destcreator. $Creator for the destination object.
URL. [Only stored for web links]. The target URL, and the HTML href
tag attribute value to use on export.
class. [Only stored for web links, and then still only stored if populated]. The HTML class
tag attribute value to use on export.
target. [Only stored for web links, and then still only stored if populated]. The HTML target
tag attribute value to use on export.
title. [Only stored for web links, and then still only stored if populated]. The HTML title
tag attribute value to use on export.