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

Greg Hellings greg.hellings at gmail.com
Fri Feb 8 01:57:07 MST 2008


Daniel,

Hmm, that's upsetting.

On Feb 8, 2008 1:44 AM, Daniel Owens <dhowens at pmbx.net> wrote:
>
>  Greg,
>
>  Thanks for the suggestion. Unfortunately it didn't work. I think the
> xlink:href is the whole attribute name, which is why the OOo-to-TEI XSLT
> filter had the attribute character before xlink.
>
>  Any other ideas?

So testing this with xsltproc, I was forced to declare the xlink:
namespace in the XSLT itself, and not just rely on the declaration of
it in the XML file.  Once I declared that, everything worked well (you
might want to add it to the list of suppressed namespaces as well, so
you don't get extraneous random namespace declarations in your OSIS
document).  I don't know the proper namespace URL for xlink, but I
just added something like xmlns:xlink="http://www.yahoo.com" to the
root stylesheet element, and that was sufficient.  It just has to
match the same URL that is declared with the xmlns:xlink="URL HERE" in
the document's XML definition.

--Greg

>
>  Daniel
>
>
>
>  Greg Hellings wrote:
>  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
>
>
>  _______________________________________________
> 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
>
>
>
>  --
> PMBX license 1502
>
>
> _______________________________________________
> 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