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

Re: XSL-FO & Selecting Attributes

Subject: Re: XSL-FO & Selecting Attributes
From: "craig webber" <craigwebber@xxxxxxxxxxx>
Date: Wed, 20 Apr 2005 11:23:25 +0000
xsl fo attributes
Thanks David,

Here's my XML document:

<publications>

<header>
<heading>Paragraph Header</heading>
<para1>Para 1 text</para1>
<para2>Para 2 text</para2>
</header>

<Item Sector="Agriculture" response="no">
<name>Poor Farmers Relief Fund</name>
<description>A Consultation on ...</description>
<publishDate>05.01.04</publishDate>
<closingDate>20.02.04</closingDate>
<urnNumber>04/1245</urnNumber>
<image>image.jpg</image>
</Item>

</publications>

My "page-sequence" is as follows:

<fo:page-sequence master-reference="page1">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="publications/Item"/>
</fo:flow>
</fo:page-sequence>

And here's my XSL-FO code I'm trying to use to select the attribute (1st block).

<xsl:template match="Item">
<fo:block>
<xsl:value-of select="@Sector"/>
</fo:block>
</xsl:template>

<xsl:template match="Item/name">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

<xsl:template match="Item/description">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

<xsl:template match="Item/publishDate">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

<xsl:template match="Item/closingDate">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

<xsl:template match="Item/urnNumber">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

<xsl:template match="Item/image">
<fo:block>
<fo:external-graphic src="url({.})"/>
</fo:block>
</xsl:template>

The result is:

Agriculture

The selection of the attribute has worked. However the result should be:

Agriculture
Poor Farmers Relief Fund
A Consultation on ..
05.01.04
20.02.04
04/1245
image

If I remove the 1st block selecting the attribute, the results are as desired, with out the attribute of course, as follows:

Poor Farmers Relief Fund
A Consultation on ..
05.01.04
20.02.04
04/1245
image

I need the results to be:

Agriculture
Poor Farmers Relief Fund
A Consultation on ..
05.01.04
20.02.04
04/1245
image

Thanks, Craig Webber.

_________________________________________________________________
Messenger just got even better - download 7.0 today! http://messenger.msn.co.za?DI=1054&XAPID=2532


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.