xsl-list
[Top] [All Lists]

Re: [xsl] reference value from XML document inside XSL for printing

2015-01-20 01:16:28
On Mon, Jan 19, 2015 at 1:38 PM, Liam R E Quin liam(_at_)w3(_dot_)org <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

On Mon, 19 Jan 2015 21:12:27 -0000
"Stephen Ingram sbingram(_at_)gmail(_dot_)com" <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

I'm using the <date></date> tags within my Docbook 5 XML document. I'd
like
to include what appears between those tags inside the header of the
document when it prints out. I'm trying to accomplish this by referencing
the <date> tags inside my XSL (FO) document,
[...]

How *exactly* are you turning your DocBook XML document into an XSl-FO
instance for printing?

Most people use XSLT for this, and it ought to be simple enough to take
the contents of the date element (XSLT deals with elements in a tree, not
tags, for what it's worth) and to put that into static content in the page
master.

For searching for examples, note that really you are putting the contents
of an element in the input document into the running header -- the fact it
happens to be a date isn't relevant here. So I wouldn't mention "date" in
your Google searches...


Yes, I did mistype that. I am actually using XSLT to try to accomplish
this. I'm using <xsl:template name="header.content"> and then using a
<xsl:choose> to select the position (left, center, right) and then trying
to place different elements there. For example, I'm suing the following to
include a logo:

<xsl:when test="$sequence='odd' and $position='center'">
    <fo:external-graphic content-height="34px">
        <xsl:attribute name="src">
            <xsl:call-template name="fo-external-image">
                <xsl:with-param name="filename"
select="$header.image.filename"/>
            </xsl:call-template>
        </xsl:attribute>
    </fo:external-graphic>
</xsl:when>

I'm specifying the actual image earlier in the template using a xsl:param
element.

I believe I know how to position items in the header as I've inserted an
image in the center, but I'm not sure how to pull the contents of the
element from the XML document itself. Everything else I've done is
specified in the XSLT document itself so it's easy to specify with a
xsl:param element. I'm sure getting the right Google search phrase is the
trick here, but I still haven't found that perfect combination yet.

Steve
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>