Thanks for that push in the right direction Peter. It was indeed the
missing fileref--when I populate that in the source xml, my template does
get picked up.

Probably this is an interesting corner-case (or maybe not that
interesting), but thanks for helping me get to back to work!
--Tim


On Mon, Nov 10, 2014 at 11:48 AM, Peter Desjardins <
[email protected]> wrote:

> When I'm not sure whether my customization template is being used, I
> drop in an <xsl:message />.
>
> <xsl:template
> match="d:inlineequation/d:inlinemediaobject[@remap='math']/d:imageobject/d:imagedata">
>     <xsl:message>FINDME: ***********************************</xsl:message>
>     <xsl:element name="img">
>       <xsl:attribute name="class">math</xsl:attribute>
>     </xsl:element>
>   </xsl:template>
>
> If you see "FINDME" in your console output, you know the template is being
> used.
>
> Your empty imagedata element seems like it's likely to cause confusion
> since you're not including any imagedata. But I haven't looked into
> the default handling of imageobject and imagedata.
>
> Peter
>
> On Mon, Nov 10, 2014 at 11:25 AM, Tim Arnold <[email protected]>
> wrote:
> > hi, I have looked at this and looked at it and still cannot see what I'm
> > doing wrong.
> > I would appreciate another set of eyes to show me the error.Trying to
> match
> > on an 'inlineequation' to produce an 'img' element, but getting a 'span'
> > instead. I've cut it down to this example:
> >
> > The XSLT:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> >   xmlns:d="http://docbook.org/ns/docbook";
> >   version="1.0" exclude-result-prefixes="d">
> >
> >   <xsl:include href="path/to/docbook/xsl-1.78.1/html/onechunk.xsl" />
> >
> >   <xsl:template
> >
> match="d:inlineequation/d:inlinemediaobject[@remap='math']/d:imageobject/d:imagedata">
> >     <xsl:element name="img">
> >       <xsl:attribute name="class">math</xsl:attribute>
> >     </xsl:element>
> >   </xsl:template>
> > </xsl:stylesheet>
> >
> > This DocBook 5 XML:
> > <article xmlns="http://docbook.org/ns/docbook";
> >   xmlns:mml="http://www.w3.org/1998/Math/MathML";
> >   xmlns:xl="http://www.w3.org/1999/xlink";>
> >  <section remap="section" xml:id="a0000000002">
> >   <info><title>Introduction</title></info>
> >    For example,
> >   <inlineequation>
> >   <inlinemediaobject remap="math">
> >     <imageobject role="math_images">
> >       <imagedata role="math" />
> >     </imageobject>
> >     <textobject role="tex">
> >       <phrase>$\alpha +\beta {}x+\varepsilon $</phrase>
> >     </textobject>
> >   </inlinemediaobject>
> > </inlineequation>.
> > </section>
> > </article>
> >
> > And I get this result, which means that my template is not getting used,
> > right? Can you see what I'm doing wrong? I omit the HTML header and intro
> > material:
> > <div class="section">
> >       <div class="titlepage">
> >         <div>
> >           <div>
> >             <h2 class="title" style="clear: both">
> >               <a name="a0000000002"></a>
> >               Introduction
> >             </h2>
> >           </div>
> >         </div>
> >       </div>
> >       For example,
> >       <span class="inlinemediaobject"></span>
> >       .
> >     </div>
> >
> > thanks in advance,
> > --Tim
> >
>

Reply via email to