[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] match with mode does not match
On Feb 3, 2008 12:37 PM, Mansour <mansour77@yahoo.com> wrote:
> I am trying t use mode with programlisting to treat the contents in a
> different way. Here's a piece of my document:
This isn't valid DocBook 4/5, as there's no programlisting/@mode, so
that's the first thing to fix:
> <example>
> <title>webapp/WEB-INF/web.xml</title>
> <programlisting mode="format-xml">
> <xi:include href="files/web.xml" />
> </programlisting>
> </example>
Perhaps you want no use programlisting/@role instead of @mode?
> Now in my customization layer I have:
>
> <xsl:template match="programlisting" mode="format-xml" priority="9.0">
> <xsl:apply-templates mode="format-xml" />
> </xsl:template>
So, this template is only matching programlistings in a specific [XSL]
mode. More on xsl:template/@mode, briefly, here:
http://www.w3schools.com/xsl/el_template.asp
In this case (assuming you've noted my warning about invalid DocBook
and changed your markup), what you actually want to do is match a very
specific programlisting in the default xsl:template/@mode (which we're
gunna omit, along with [probably] unnecessary @priority):
<xsl:template match="programlisting[@role = 'format-xml']>
<!-- This format-xml mode had better be defined somewhere in
your customization. Otherwise drop. -->
<xsl:apply-templates mode="format-xml" />
</xsl:template>
> But it's not matching. I changed the value of the priority.
@priority won't help a non-matching template. This one failed to match
on xsl:template/@mode, but you could have been more specific in your
xsl:template/@match (see above).
HTH,
Keith
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]