Placing Hyperlinks via IDML
i've managed put few xsl stylesheets , scripts (perl, awk, bash) transform own 'markup' idml. (i found convenient , reliable method automate placing footnotes.)
to that, i've consulted idml specifications adobe, official 'cookbook'; , i've tested xmls adobe's own schemas inside sdk (via emacs's nxml mode); , everything working fine documents produced—with single exception: hyperlinks (to refer text anchors within same document).
when i'm referencing 'static' bits of text inside same document, prefer hyperlinking on cross-referencing, in former allows me use text links. on hyperlinks panel, and in story editor, see idml-placed hyperlinks; when exported pdf or html, don't work. more precisely, 1 or 2 of them work expected, , rest broken; although there's absolutely no visible difference between 'source code' 2 kinds.
i prepared several 'templates', in order see how hyperlinks when defined inside indesign, , exported idml. having examined those, still can't see i'm doing wrong.
acrobat recognizes of 'hyperlinktextdestination's, not links themselves; , exporting idml/re-importing .indd doesn't either.
this hugely frustrating. now—i'd grateful if tell me what's wrong link sources , destinations, , forth, refuse work. hope it's i'm making careless mistake xml attributes , such (i'm novice in these matters):
this how 'hyperlinktextsource' looks, inside main story xml:
<characterstylerange appliedcharacterstyle="characterstyle/$id/[no character style]">
<hyperlinktextsource self="#the unique id of destination, assigned me#" name="#uniquely generated (random) name#" hidden="false" appliedcharacterstyle="n">
<content>#the bit of text serve link#</content>
</hyperlinktextsource>
</characterstylerange>
my 'hyperlinktextdestination's this, inside main story xml:
<hyperlinktextdestination self="hyperlinktextdestination/#the unique id of destination, assigned me#" name="#unique (random) name#" hidden="false"/>
and this, hyperlink specification inside designmap.xml:
<hyperlink self="#unique (random) name#" name="#unique id of destination, assigned me#" source="#unique id of destination, assigned me#" visible="false" highlight="none" width="thin" borderstyle="solid" hidden="false">
<properties>
<bordercolor type="enumeration">black</bordercolor>
<destination type="object">hyperlinktextdestination/#unique id of destination, assigned me#</destination>
</properties>
</hyperlink>
this bit of xslt produces 'source':
<xsl:template match="#my chosen element name links#">
<characterstylerange appliedcharacterstyle="characterstyle/$id/[no character style]">
<hyperlinktextsource self="{@linkend#the unique id of destination#}" name="{@linkend}_{generate-id(.)}" hidden="false" appliedcharacterstyle="n">
<content><xsl:value-of select="."/></content>
</hyperlinktextsource>
</characterstylerange>
</xsl:template>
the destination producer:
<hyperlinktextdestination self="hyperlinktextdestination/{@id#the unique id, assigned me#}" name="{@id#...same before#}" hidden="false"/>
and, responsible hyperlink elements inside designmap.xml:
<hyperlink self="{@linkend}dest{generate-id(.)}" name="{.}" source="{@linkend}" visible="false" highlight="none" width="thin" borderstyle="solid" hidden="false">
<properties>
<bordercolor type="enumeration">black</bordercolor>
<destination type="object">hyperlinktextdestination/<xsl:value-of select="@linkend"/></destination>
</properties>
</hyperlink>
ps. don't transform indesign-xmlelements; of becomes regular text. don't think it's worth hassle: id's xml-handling capabilities rudimentary.
minor update:
i changed xslt give 'destinationuniquekey'* destinations , corresponding designmap.xml references; still doesn't work.
(* number [int] of nodes start context node of destination.)
anyone?
.
.
.
this driving me crazy.
More discussions in InDesign SDK
adobe
Comments
Post a Comment