[sword-devel] Another XPath question for OSIS export filter

Greg Hellings greg.hellings at gmail.com
Fri Feb 8 00:05:16 MST 2008


Daniel,

I'm not 100% sure on this, but XSL might expect the attribute
indicator (the character @) to be on the attribute name rather than on
the namespace token.  Try changing those lines as follows:

On Feb 8, 2008 12:59 AM, Daniel Owens <dhowens at pmbx.net> wrote:
>
>  The OpenOffice OSIS export filter is well on its way to being usable, but I
> am trying to figure out how to render images. I have the following code:
>
>    <xsl:template match="draw:image">
>      <figure>
>        <xsl:attribute name="src">
>          <xsl:choose>
>            <xsl:when test="@xlink:href">
>              <xsl:value-of select="@xlink:href" />

Make these
<xsl:when test="xlink:@href">
  <xsl:value-of select="xlink:@href" />

and you might have success.  That's just a shot in the dark, but it's
what I would try first.

--Greg

>            </xsl:when>
>            <xsl:otherwise>
>              <xsl:text>Missing image path</xsl:text>
>            </xsl:otherwise>
>          </xsl:choose>
>        </xsl:attribute>
>      </figure>
>    </xsl:template>
>
>  Here is the source xml from an .odt file:
>
>  <draw:image xlink:href="Pictures/1000000000000190000000942BD8CECD.jpg"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
>
>  Here is what is exported currently:
>
>    <figure src="Missing image path"/>
>
>  Here is what I want to be exported:
>
>    <figure src="Pictures/1000000000000190000000942BD8CECD.jpg"/>
>
>  I've underlined the part of the code that is the source of difficulty. I'd
> appreciate any help.
>
>  Daniel
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>



More information about the sword-devel mailing list