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

Re: Conditional processing for first and last of a set

Subject: Re: Conditional processing for first and last of a set of elements
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Mar 2004 07:51:25 -0500
xslt last of
At 2004-03-10 06:52 -0500, Munna D wrote:
I have a series of br elements scattered throughout an xhtml document. I would like to change the very first <br> to '<tr><td>', the intervening ones to '</td></tr><tr><td>', and the last one to '</td></tr>'

That is a syntactic transformation requirement, not an information transformation requirement, thus XSLT is not the appropriate tool for your stated needs.


I have got this template at teh moment
  <xsl:template match="//br[text()='LineNumberHolder']">

Such a template for an element node with the name "br" dictates the nodes (*NOT* the syntax) to construct in the result tree. The syntax representation for a node is well-formed XML and your strings of markup are not well-formed.


Your stated requirement is to manipulate angle brackets of the syntax, and that is expressly not in the scope of XSLT.

Please could someone tell me what I'm doing wrong?

You are using the wrong tool. XSLT is not designed to do arbitrary syntax manipulation. XSLT is designed to do node manipulation where a node can be represented as well-formed markup with appropriate start and end tags (not only one or the other).


I hope this helps.

.......................... Ken

--
US XSL training: Washington,DC March 15; San Francisco,CA March 22
World-wide on-site corporate, government & user group XML training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.