[daisy] Include documents in sequence of a BookDefinition
Bruno Dumon
bruno at outerthought.org
Tue Jul 24 08:33:45 CDT 2007
On Tue, 2007-07-24 at 14:59 +0200, Hofmann. David wrote:
>
> Thanks for you help, Bruno.
> I found the template editIncludedDocLink in document-to-html.xsl and
> thought I could reuse it. However, this requires the variable $document
> to be set.
>
> If I understand the documentation correctly, the publisher result has
> the structure
> <p:publisherResponse xmlns:p="http://outerx.org/daisy/1.0#publisher">
> <p:document>
> <p:preparedDocuments applyDocumentTypeStyling="true">
> <p:preparedDocument>
> <p:publisherResponse>
> <d:document>
> ...
>
You can see the exact structure by adjusting the pipeline in the
sitemap.xmap to serialize the output as XML before going through the
remainder of the transformations:
<map:match pattern="navaggr-result">
<map:generate type="jx" src="navaggr_result.xml"/>
<map:serialize type="xml"/>
</map:match>
The content of p:preparedDocuments is extracted by the wiki to apply
document-styling onto it, its content is later merged back by the
DaisyIncludePreparedDocuments transformer (see sitemap.xmap), after the
XSL is applied.
> So I tried to call the template in the for-each loop:
> <xsl:for-each
> select="p:publisherResponse/p:document/p:preparedDocuments">
> <xsl:call-template name="editIncludedDocLink">
> <xsl:with-param name="document"
> select="p:publisherResponse/d:document"/>
> </xsl:call-template>
> ...
>
> But unfortunately the param is empty. How can I access d:document in the
> loop?
You'll have to change navaggr_pubreq.xsl and add a p:annotatedDocument
instruction next to the p:preparedDocuments. Also add a p:aclInfo to get
info about the access rights on the documents.
> Is it a good idea to reuse the template at all?
Yes, seems like a good idea.
> Thanks for your help!
> David
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
More information about the daisy
mailing list