[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: reference value from XML document inside XSL for

Subject: Re: reference value from XML document inside XSL for printing
From: "Stephen Ingram sbingram@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Jan 2015 07:16:18 -0000
Re:  reference value from XML document inside XSL for
On Mon, Jan 19, 2015 at 1:38 PM, Liam R E Quin liam@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Mon, 19 Jan 2015 21:12:27 -0000
> "Stephen Ingram sbingram@xxxxxxxxx" <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.