The nodes disb and refunds represent a transaction.. Disb receiving, refunds
sending. I want to create an html table that displays a list of disb and
refunds for a student ordered by the program first and then inside each
program section it will be ordered by date to represent a history of
transactions with the student. Below is the html table...
Student Page>
Name:Foo Foo
SSN: 123-23-1234
Year: 2004
Term: 1
Program amount processdate
Abc 500 1/1/2005
(-)200 2/25/2005
------Total--300--[refundTxtBox][Submit-NewRefundAmt]---
Def 1000 3/5/2005
500 5/5/2005
(-)500 7/9/2005
------Total-1000--[refundTxtBox][Submit-NewRefundAmt]---
.
.
.
I have no way now to get the dates in order without calling some ridiculous
recursive template that sorts the nodes for me and prints the appropriate
one. Loop.. Print. which could result in a high number of passes..
Soo.. My whole goal was to get these two nodesets together into one set
called trans so that I could just create the new childnode called Ttype to
identity it as a debit or credit and then sort the whole list by process
date. Then I would take the new result set and print out my above
table/form.
All of this was successful (Thanks to you, of course) except for acutally
printing the table because I was not aware that a tree frag could not be
looped through without using an xslt extension. (Plans ruined.. Scrap the
page. grrrr)
Anyways.. I'll read more and see if I can understand your previous solution
so that I can modify it to print the table..
Thanks Again,
Chris
-----Original Message-----
From: Wendell Piez [mailto:wapiez(_at_)mulberrytech(_dot_)com]
Sent: Friday, April 01, 2005 3:17 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Combining two node Sets into one
Hi Chris,
At 12:47 PM 4/1/2005, you wrote:
Everything seems to be working good. (except the sort.. But I think I
can figure that out) However, when I assign the value to a variable and
try to use it later in my stylesheet..as I'm sure you know.. you cannot
use most xpath expression on a tree frag.
You can't query into *any* result tree fragment with an XPath, in
unextended XSLT 1.0. The method of running successive transformations in a
chain is available only if you pipeline stylesheets, use an extension
function, or use XSLT 2.0.
But if you want help on this I'm afraid you'll have to be more explicit,
with code samples.
Not fully understanding how your example actually works I can't figure
out how to wrap it so that the data creates my desired table. If they
would only let me redo the xml. *sigh*.
It's true that the design of your input is pretty lame, but it's not the
worst I've ever seen, and the transform really shouldn't be so bad.
But your question was regarding an XML->XML transform, where the target tag
set has such elements as <Tamount> and so forth. There's no table there.
I take it you want either (a) to go now from the <Trans> elements into a
table (HTML or FO or something else: you haven't said) or (b) to go
straight from your source into a table, not into the <Trans> elements at
all.
Either of these can be done, and neither goes beyond what's pretty easy to
do in a single XSLT 1.0 transformation (no pipelining required).
Thanks for the help.. If you have time can you also explain at a high
level how wrapping an expression in an xml tag works to generate the
combined nodes.. Ie..
<xsl:template match="Damount">
<Tamount> <!---xml tag
<xsl:apply-templates/>
</Tamount>
</xsl:template>
Well, that's called a "literal result element". Rather than taking the time
here to explain it, I'll leave you to the reference books and your favorite
search engine to find.
Actually, in view of how basic this is, I'd recommend digging into some of
the introductory literature on XSLT, on- or off-line, before posting again.
Your questions here would all be answered by a good descriptive overview of
the language, how templates work, what literal result elements are etc.
Cheers,
Wendell
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--