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:%22Thomas+Schraitle%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Thomas Schraitle</span></span></a></span> <span class="date"><a href="/search?l=docbook-apps@lists.oasis-open.org&q=date:20130404" rel="nofollow">Thu, 04 Apr 2013 23:53:39 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>Hi Eric, On Fri, 5 Apr 2013 01:00:45 +0000 Eric Nordlund <nordl...@cray.com> wrote:</pre><pre> > [... @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 </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg18886.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd5.html#18890">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail5.html#18890">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg18891.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 tSliceCur"><span class="subject">Re: [docbook-apps] xrefs to <title> elements d...</span> <span class="sender italic">Thomas Schraitle</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18891.html">Re: [docbook-apps] xrefs to <title> elemen...</a></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="20130405085330.002402a3@edison.suse.de"> <input type="hidden" name="relpath" value="docbook-apps@lists.oasis-open.org/msg18890.html"> <input type="submit" value=" Thomas Schraitle "> </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="msg18886.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg18891.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">20130405085330.002402a3@edison.suse.de</li> </ul> </div> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9da846865a73c526',t:'MTc3MzIwODE2Mg=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script>