Hi
This in partial code os my stylesheet!
What I do to create the TOC is this :
<fo:block>
<xsl:for-each select="//course[course_group=$group]">
<xsl:sort select="title" />
<fo:block text-align-last="justify">
<fo:basic-link>
<xsl:attribute name="internal-destination">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
<xsl:value-of select="title"/>
<fo:leader leader-pattern="dots" />
<fo:page-number-citation>
<xsl:attribute name="ref-id">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
</fo:page-number-citation>
</fo:basic-link>
</fo:block>
</xsl:for-each>
</fo:block>
After to create each course information, I do this :
<!-- Create Pages -->
<xsl:for-each select="//course[course_group=$group]">
<xsl:sort select="title" />
<fo:block break-before="page" xsl:use-attribute-sets="pdf-title">
<xsl:attribute name="id">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
</fo:block>
<fo:block xsl:use-attribute-sets="page-title">
<xsl:value-of select="title" />,
<xsl:value-of select="course_num" />
(CRN:<xsl:value-of select="@crn" />)
</fo:block>
<fo:block xsl:use-attribute-sets="normal">
Meeting Information:
<fo:block>
Days: <xsl:value-of select="./metting/meeting_days" />
</fo:block>
<fo:block>
Begin: <xsl:value-of select="/metting/meeting_begin" />
</fo:block>
<fo:block>
End: <xsl:value-of select="/metting/meeting_end" />
</fo:block>
<fo:block>
Location: <xsl:value-of select="/metting/location" />
</fo:block>
<fo:block>
Professor: <xsl:value-of select="person_name" />
</fo:block>
<fo:block>
Title: <xsl:value-of select="person_name" />
</fo:block>
<fo:block>
Course Description: <xsl:value-of select="description" />
</fo:block>
</fo:block>
</xsl:for-each>
In the courses.xml there are several course_group duplicates, I onyl need
one of each, I guess
I have to use the document-id()
But not sure of to obtain unique course groups that match the group and year
parameter.
I hope this explain better the problem
The final otput (pdf) should be something like this
Fullname Title
course
1.......................................................................2
course
2.......................................................................3
On Page 2:
Course 1 Name
Course Information
On Page 3:
Course 2 Name
Course Information
-----------------------------------
thx a lot for the help.
LuisMM
From: cknell(_at_)onebox(_dot_)com
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: RE: RE: [xsl] Hello, some problems with XSL-FO
Date: Fri, 19 Dec 2003 15:14:41 -0500
It seems that the information required to make a table of contents is
considerably less than what you supplied in your XML document
"courses.xml". I'll take the liberty to strip off what appears to be excess
in order to make the problem simpler to understand. Does this sample
contain all the information required to make the table of contents?
<dce_courses>
<course acad_year="2003" term_id="2" crn="21135">
<course_group>AFAM</course_group>
<course_num>E-110</course_num>
<title>Images of Africana People in Cinema</title>
</course>
<course acad_year="2003" term_id="2" crn="22066">
<course_group>ANTH</course_group>
<course_num>E-135</course_num>
<title>The Archaeology of the American Southwest</title>
</course>
<dce_courses>
If it contains anything not strictly needed to illuminate the table of
contents issue, please feel free to strip it further. If I have removed
something necessary to understanding the problem, please put it back and
re-post.
If I understand you correctly, you want to select the subset of all courses
that have a <course_group> child whose value is equal to the "group"
parameter and whose "acad_year" attribute is equal to the "year" parameter
you pass to the stylesheet. Is that correct? The XPath expression would be
like, "course[(_at_)acad_year=$year][course_group=$group]".
In SQL terms we might say "SELECT course FROM courses WHERE course_group =
$group and acad_year = $year". That would give us the set of courses you
are interested in.
Now let's look at the problem of duplicates. Based on the values of which
elements and attributes would you judge that two courses are duplicates?
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list