OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] How to mark a programlisting non-translatable


> 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>

Depending on which stylesheets youâre using, you may be able to achieve
this by simply changing your programlisting, for example:

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

> 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>

Namespaces can be a bit tricky to get right.

You probably have that namespace declaration at the top of your
stylesheet. If you donât want the elements output to be in that
namespace, remove the declaration.

If you canât do that for some reason, then you can put the pre element
in no namespace:

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

That declaration wonât be output if the rest of the document is already
in no namespace. If the rest of the document is in some other namespace,
then you can change the xmlns declaration at the top of your stylesheet
to that namespace or change the binding on the pre element to that
namespace, depending on which makes more sense.

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh <ndw@nwalsh.com>
https://norm.tovey-walsh.com/

> He that shuns trifles must shun the world.--George Chapman

Attachment: signature.asc
Description: PGP signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]