How to mark a programlisting non-translatable

[email protected] Fri, 19 May 2023 10:37:17 +0700
Newsgroups gmane.text.docbook.misc
Message-ID <[email protected]>
Hello,

currently the text in a <programlisting> element looks like this in the 
resulting HTML:

<pre class="programlisting">
some program lines
</pre>

I need that the result should look like the following to turn on syntax 
highlighting and more importantly to prevent automatic translation of 
meaningful strings in the listing (say comments) from happening:

<pre class="programlisting highlight-shell notranslate">
some program lines
</pre>

I've tried to add such a transformation to stylesheet.xsl:

<xsl:template match="programlisting">
   <pre class="programlisting highlight-shell notranslate">
     <xsl:apply-templates/>
   </pre>
</xsl:template>

This basically does what I need but a stray xmlns attribute appears in 
pre:

<pre xmlns="http://www.w3.org/TR/xhtml1/transitional" 
class="programlisting highlight-shell notranslate">
some program lines
</pre>

I don't think this xmlns is required and I'm not even sure it is valid 
to place xmlns somewhere other than inside a root element much earlier 
in the declaration of the entire document. Could you please advice me 
how to command docbook to produce the HTML I need i.e. the pure <pre 
class="programlisting highlight-shell notranslate">? Or maybe there's 
another way of marking a programlisting in docbook non-translatable?

Thanks a lot,
Alexey