Re: [docbook-apps] xrefs to elements don't work</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=docbook-apps@lists.oasis-open.org&q=from:%22Aaron+DaMommio%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Aaron DaMommio</span></span></a></span> <span class="date"><a href="/search?l=docbook-apps@lists.oasis-open.org&q=date:20130405" rel="nofollow">Fri, 05 Apr 2013 05:58:42 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>It sounded like, from Nordlund's description, his sections already have IDs. So it might cause problems to replace those IDs.</pre><pre> We'd need to know: do ALL xrefs target titles, NONE of them target actual sections? --Aaron DaMommio On Fri, Apr 5, 2013 at 1:53 AM, Thomas Schraitle <tom_s...@web.de> wrote: > Hi Eric, > > On Fri, 5 Apr 2013 01:00:45 +0000 > Eric Nordlund <nordl...@cray.com> wrote: > > > [... @id attributes in titles instead of parent...] > > > > Is there a way to make these work in the XSL-FO output? I was > > thinking I could have a template that could recognize when an > > xref/@linkend pointed to the id of a title and then change the > > linkend to the id of the title's parent element, but I don't really > > know how to do that. > > > > Is there another way to do what I need to do? > > Well, my impression was that the DocBook XSL stylesheets takes this > into account, so in theory it doesn't matter if the @id was placed > wrongly. Maybe I'm wrong, I haven't tested that. > > However, if you really care, I would target your issue from a different > angle: use XSLT to move your @id attribute to its parent element. Pass > the result to your DocBook stylesheets (or your customization layer). > No FO customization is needed in this case. :) > > Here is a stylesheet that moves an @id attribute from a title > element to its parent element (probably it's incomplete, but it should > be easy to extent it): > > --------------------------------- > <xsl:stylesheet xmlns:xsl="<a rel="nofollow" href="http://www.w3.org/1999/XSL/Transform"">http://www.w3.org/1999/XSL/Transform"</a>; > version="1.0"> > > <xsl:output method="xml" > indent="yes" > doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" > doctype-system="<a rel="nofollow" href="http://www.docbook.org/xml/4.5/docbookx.dtd"/">http://www.docbook.org/xml/4.5/docbookx.dtd"/</a>> > > <xsl:template match="node() | @*" name="copy"> > <xsl:copy> > <xsl:apply-templates select="@* | node()"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="title/@id"/> > > <xsl:template name="copytitleid"> > <xsl:copy> > <xsl:copy-of select="@*"/> > <xsl:if test="(title/@id| > *[contains(local-name(),'info')]/title/@id)"> > <xsl:attribute name="id"> > <xsl:value-of select="(title/@id| > > *[contains(local-name(),'info')]/title/@id)[1]"/> > </xsl:attribute> > </xsl:if> > <xsl:apply-templates/> > </xsl:copy> > </xsl:template> > > <xsl:template match="appendix|article|book| > bibliography|bibliodiv| > chapter|colophon| > dedication|glossary| > preface|part|reference| > refsection|refsect1|refsect2|refsect3| > set| > section|sect1|sect2|sect3|sect4|sect5"> > <xsl:call-template name="copytitleid"/> > </xsl:template> > > <xsl:template match="figure|example|procedure|task"> > <xsl:call-template name="copytitleid"/> > </xsl:template> > > </xsl:stylesheet> > --------------------------------- > > -- > Gruß/Regards, > Thomas Schraitle > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org > > -- -------------------------------------- Aaron DaMommio: Husband, father, writer, juggler, and expert washer of dishes. - My blog: <a rel="nofollow" href="http://aarondamommio.blogspot.com">http://aarondamommio.blogspot.com</a> - Need a juggler? <a rel="nofollow" href="http://amazingaaronjuggler.blogspot.com/">http://amazingaaronjuggler.blogspot.com/</a> ======================================= </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg18890.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd5.html#18891">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail5.html#18891">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg18903.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg18886.html">[docbook-apps] xrefs to <title> elements don't work</a></span> <span class="sender italic">Eric Nordlund</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18890.html">Re: [docbook-apps] xrefs to <title> elements d...</a></span> <span class="sender italic">Thomas Schraitle</span></li> <li><ul> <li class="icons-email tSliceCur"><span class="subject">Re: [docbook-apps] xrefs to <title> elemen...</span> <span class="sender italic">Aaron DaMommio</span></li> </ul></li> <li class="icons-email"><span class="subject"><a href="msg18903.html">Re: [docbook-apps] xrefs to <title> elements d...</a></span> <span class="sender italic">Bob Stayton</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18906.html">RE: [docbook-apps] xrefs to <title> elemen...</a></span> <span class="sender italic">Eric Nordlund</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18966.html">Re: [docbook-apps] xrefs to <title> el...</a></span> <span class="sender italic">Bob Stayton</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18967.html">Re: [docbook-apps] xrefs to <title>...</a></span> <span class="sender italic">Bob Stayton</span></li> </ul> </ul> </ul> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="Re: [docbook-apps] xrefs to <title> elements don't work"> <input type="hidden" name="msgid" value="CAOm3+YzbZNB+9UH5syYaX=S9HhSsuFjLUC+JNrrYaCroZMjnaw@mail.gmail.com"> <input type="hidden" name="relpath" value="docbook-apps@lists.oasis-open.org/msg18891.html"> <input type="submit" value=" Aaron DaMommio "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="docbook-apps@lists.oasis-open.org"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search docbook-apps"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/docbook-apps@lists.oasis-open.org/">docbook-apps - all messages</a></li> <li class="icons-about"><a href="/docbook-apps@lists.oasis-open.org/info.html">docbook-apps - about the list</a></li> <li class="icons-expand"><a href="/search?l=docbook-apps@lists.oasis-open.org&q=subject:%22Re%5C%3A+%5C%5Bdocbook%5C-apps%5C%5D+xrefs+to+%3Ctitle%3E+elements+don%27t+work%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg18890.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg18903.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">CAOm3+YzbZNB+9UH5syYaX=S9HhSsuFjLUC+JNrrYaCroZMjnaw@mail.gmail.com</li> </ul> </div> </body> </html>