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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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


Subject: Re: [docbook-apps] Entityref + docbookxsl: unparsed-entity-uri()does not resolve


Diego Ballve wrote:
> Mauritz Jeanson wrote:
>>As far as I can tell, entityrefs don't work when you use profiling. The
>>filtered result from the first profiling step is stored in a temporary
>>node-set. When this result is processed in turn and unparsed-entity-uri() is
>>applied, the entity declared in the source document is no longer available.
>
> Thanks! That was exactly the problem here.
> Entityrefs work if I use ../fo/docbook.xsl

Peter Mikula, from Digital Artefacts, pointed me a simple solution for
getting entityrefs + profiling working. Sharing with the list:

Add this to your customization layer:

  <!--
    entityref + profile fix:
    entity resolver relative to original document
    replace unparsed-entity-uri() calls w/ template call
  -->
  <xsl:param name="da-custom.resolverDocument" select="/"/>
  <xsl:template name="unparsed-entity-uri">
    <xsl:param name="name"/>
    <xsl:for-each select="$da-custom.resolverDocument">
      <xsl:value-of select="unparsed-entity-uri($name)"/>
    </xsl:for-each>
  </xsl:template>

and overwrite all the templates that call unparsed-entity-uri(), for
example 'mediaobject.filename' in common/common.xsl, replacing:

  <xsl:value-of select="unparsed-entity-uri($data/@entityref)"/>

with:

  <xsl:call-template name="unparsed-entity-uri">
    <xsl:with-param name="name" select="$data/@entityref"/>
  </xsl:call-template>

Regards,
Diego

--
Diego Ballve
Digital Artefacts Europe
http://www.digital-artefacts.fi/

OpenPGP digital signature



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