Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2010, 02:53 PM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default newbie concat loop question

I have "area text" that can be in one or multiple records in the database (and therefore in XML node elements).

I can use the code below to output this text line by line, but what I would really like to do is concatenate it into one long string and then output it, wrapping based on the available width.

Can anyone help me with this?

Current Code:
<xsl:template match="AREA/SMRACMT_ROWSET/SMRACMT_SET">
<fo:block font-size="8">
<xsl:for-each select="SMRACMT_TEXT" />
<xsl:value-of select="."/>
</fo:block>
</xsl:template>

Current Output:
Anatomy and Physiology needs to have been completed at MSU
within the last 5 years with a minimum grade of 2.0.
For an equivalent transfer of BIO 227 and BIO 228 from
another institution, students need to have completed a full
year of Anatomy and Physiology and one semester of
Microbiology within the last 5 years with a grade of 2.5 or
better.


Desired Output:
Anatomy and Physiology needs to have been completed at MSU within the last 5 years with a minimum grade of 2.0. For an equivalent transfer of BIO 227 and BIO 228 from another institution, students need to have completed a full year of Anatomy and Physiology and one semester of Microbiology within the last 5 years with a grade of 2.5 or better.
 
Old December 8th, 2010, 02:07 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Try the below:
Code:
<xsl:template match="AREA/SMRACMT_ROWSET/SMRACMT_SET">
<fo:block font-size="8">
<xsl:value-of select="SMRACMT_TEXT"/>
</fo:block>
</xsl:template>
__________________
Rummy
 
Old December 8th, 2010, 09:16 AM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Same results

I get the same results - each element is printed on a separate line.
I was hoping there was a way to print each area_text element, a space, and then the next area_text element, wrapping as needed.

Thank you for your response, though!
 
Old December 9th, 2010, 06:53 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Post your input xml, full xslt code and the output expected from the input xml.
__________________
Rummy





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Loop with counter and concat chilly XSLT 19 July 28th, 2010 11:34 AM
Newbie question peterh Classic ASP Databases 3 January 17th, 2008 12:25 PM
C# Newbie Question jazzcatone ASP.NET 2.0 Basics 1 May 25th, 2006 10:18 PM
Newbie question Beginner VB.NET 2002/2003 Basics 2 November 9th, 2003 07:58 AM
Newbie question maccer88 Access 1 October 18th, 2003 05:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.