[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Re: html navigation <link> elements
Hi Sam, Well, the user.head.content template is called for each chunk, so that it can have different content in each chunk if necessary. But you could speed it up by creating two global variables in your customization to compute the values of the attributes just once when the stylesheet loads, and then change the attributes to use those values: Top level: <xsl:variable name="faq.target" select="key('id', 'faq-help')"/> <xsl:variable name="faq.href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$faq.target"/> </xsl:call-template> </xsl:variable> (same for title) Inside user.head.content: <link rel="help" href="{$faq.href}" title="{$faq.title}"/> Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Sam Steingold" <sds@podval.org> To: <docbook-apps@lists.oasis-open.org> Sent: Monday, May 08, 2006 12:51 PM Subject: [docbook-apps] Re: html navigation <link> elements >> * Bob Stayton <obof@fntruvyy.arg> [2006-05-08 11:05:20 -0700]: >> >> <xsl:variable name="faq.target" select="key('id', 'faq-help')"/> >> >> <link rel="help"> >> <xsl:attribute name="href"> >> <xsl:call-template name="href.target"> >> <xsl:with-param name="object" select="$faq.target"/> >> </xsl:call-template> >> </xsl:attribute> >> <xsl:attribute name="title"> >> <xsl:variable name="question.content"> >> <xsl:apply-templates select="$faq.target/question/node()"/> >> </xsl:variable> >> <xsl:value-of select="$question.content"/> >> </xsl:attribute> >> </link> > > thanks, this works (I had to use > <xsl:value-of select="normalize-space($question.content)"/> because of > linebreaks in <question>). > > is this code called once or every time a file is written? > can this be a performance issue? > > -- > Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 5 > (Bordeaux) > http://thereligionofpeace.com http://palestinefacts.org http://memri.org > http://ffii.org http://openvotingconsortium.org http://iris.org.il > I haven't lost my mind -- it's backed up on tape somewhere. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]