Language code (xml:lang) in header

已查看 14 次
跳至第一个未读帖子

Stefan Eike

未读,
2022年4月6日 09:48:312022/4/6
收件人 DITA-OT Users
Hi,

I need to add the xml:lang of the current <part>, <chapter> or <topic> into the header. What sounds easy seems to be quite difficult.

The templates to modify in static-content.xsl are
– insertBodyEvenHeader
–insertBodyOddHeader

It is easy to add or remove <prodname>, <heading> and <pagenum>, but the language code...

Do you have an idea?

Radu Coravu

未读,
2022年4月7日 01:09:312022/4/7
收件人 Stefan Eike、DITA-OT Users
Hi Stefan,
So if inside the xsl:templates named "insertBodyEvenHeader" or "insertBodyOddHeader" you use something like this:

<xsl:value-of select="ancestor-or-self::*[@xml:lang]/@xml:lang"/>

it does not work, right?
I see that templates like ""processTopicPart"" or 'processTopicChapter" sometimes start a new <fo:page-sequence> and call the "insertBodyStaticContents" template in the right context.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/265fb10a-df0a-4da4-8450-150dc3b0ce50n%40googlegroups.com.

Stefan Eike

未读,
2022年4月7日 05:29:022022/4/7
收件人 DITA-OT Users
Hi Radu,

yes, I tried '<xsl:variable name="lang" select="ancestor-or-self::*[@xml:lang]/@xml:lang"/>' in 'processTopicPart', 'processTopicChapter', and 'insertBodyStaticContents'. Unfortunately it did not work and I'm still groping around in the dark. Will try something similar in other templates. I don't know how to debug this.

Radu Coravu

未读,
2022年4月7日 06:53:452022/4/7
收件人 Stefan Eike、DITA-OT Users
Hi Stefan,

I'm not sure, maybe for example in the template "insertBodyStaticContents" you add an xsl:message and publish you could see for what context nodes it gets called.

<xsl:message>Context <xsl:copy-of select="."/></xsl:message>

Also in the "processTopicChapter" template add an xsl:message to see if for each chapter a new <fo:page-sequence> is being created because I reckon in your case you have to create a new page sequence for each chapter in order to change the header text.

Regards,
Radu

回复全部
回复作者
转发
0 个新帖子