B
bjam
Hi,
I am hoping someone can help with this I am assuming it is pretty
basic but I don't see anything that jumps out at me at how to do this.
Is there a way to have all the items output from the style sheet appear
as a single line with no return chars?? When executing the following
style sheet, how can I concatenate the values together in a single
line, in this case a single line would be how the browser displays
this, but I want the general text output to be a single line as well.
Basically is there a way to have all these lines concatenated together
when being outputted by the style sheetinstead of having a return
character after each line? Also, is there a way to have the xslt know
to not produce the last pipe on the line??? Maybe some type of
following-sibling??
Thanks in advance for your help. I appreciate it.
Desired Ouptput (note last data element does not have pipe)
================
<html xmlns:rep="http://localhost:7001/reporting"><body><table
border="0"><tr><td>11006732.908899993|</td><td>7941634.67709|</td><td>3065098.23181004|</td><td>3065098.23181004|</td><td>11006732.908899993</td></tr></table></body></html>
The output I am getting
( returns in output and last data element does have pipe)
=======================
$ test_XSLT.pl ( this is just my perl code that translates XSLT)
<html xmlns:rep="http://localhost:7001/reporting"><body><table
border="0"><tr>
<td>11006732.908899993|</td>
<td>7941634.67709|</td>
<td>3065098.23181004|</td>
<td>3065098.23181004|</td>
<td>11006732.908899993|</td>
</tr></table></body></html>
END OF TEST ./test_XSLT.pl
Style sheet below
==================
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rep="http://localhost:7001/reporting">
<xsl:template match="/">
<html>
<body>
<table border="0">
<tr>
<xsl:apply-templates
select="/rep:FrontPage/rep:frontPageSection/rep:sectionLine"/>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template
match="/rep:FrontPage/rep:frontPageSection/rep:sectionLine">
<xsl:apply-templates select="rep:lineName[starts-with(text(),'MARGIN
EQUITY')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'HOUSE
REQUIREMENTS')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'HOUSE
MARGIN EXCESS/DEFICIT')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'CASH
AVAILABLE')]"/>
</xsl:template>
<!-- MARGIN EQUITY -->
<xsl:template match="rep:lineName[starts-with(text(),'MARGIN
EQUITY')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- HOUSE REQUIREMENTS-->
<xsl:template match="rep:lineName[starts-with(text(),'HOUSE
REQUIREMENTS')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- HOUSE MARGIN EXCESS DEFICIT -->
<xsl:template match="rep:lineName[starts-with(text(),'HOUSE MARGIN
EXCESS/DEFICIT')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- CASH AVAILABLE -->
<xsl:template match="rep:lineName[starts-with(text(),'CASH
AVAILABLE')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
</xsl:stylesheet>
Data Snippet
=============
<rep:FrontPage xmlns:rep="http://localhost:7001/reporting">
<rep:dateGenerated q="1">Fri Apr 1 14:49:29 2005</rep:dateGenerated>
<rep:dateGeneratedTimeZone q="1">Eastern Standard Time
(US/Eastern)</rep:dateGeneratedTimeZone>
<rep:date q="1">2005-03-31-05:00</rep:date>
<repreviousDate q="1">2005-03-30-05:00</repreviousDate>
<rep:frontPageSection>
<rep:sectionName q="1">GLOBAL MARGIN ROLL-UP (USD)</rep:sectionName>
<rep:sectionLine>
<rep:lineName q="1">MARGIN EQUITY</rep:lineName>
<rep:amountAtDate q="0">11006732.908899993</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.0115977892</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">HOUSE REQUIREMENTS</rep:lineName>
<rep:amountAtDate q="0">7941634.67709</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">HOUSE MARGIN EXCESS/DEFICIT</rep:lineName>
<rep:amountAtDate q="0">3065098.23181004</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.011597789</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">CASH AVAILABLE</rep:lineName>
<rep:amountAtDate q="0">3065098.23181004</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.011597789</rep:amountAtPreviousDate>
</rep:sectionLine>
</rep:frontPageSection>
<rep:frontPageSection>
<rep:sectionName q="1">US COMBINED MARGIN PB </rep:sectionName>
<rep:sectionLine>
<rep:lineName q="1">LONG MARKET VALUE</rep:lineName>
<rep:amountAtDate q="0">91617178.1389</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">SHORT MARKET VALUE</rep:lineName>
<rep:amountAtDate q="0">-5365772.36</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">CASH BALANCE CR (DR)</rep:lineName>
<rep:amountAtDate q="0">-75857105.73</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">BOND ACCRUED INTEREST</rep:lineName>
<rep:amountAtDate q="0">612432.86</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">REG U EXCESS/DEFICIT</rep:lineName>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">MARGIN EQUITY</rep:lineName>
<rep:amountAtDate q="0">11006732.908899993</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
</rep:frontPageSection>
I am hoping someone can help with this I am assuming it is pretty
basic but I don't see anything that jumps out at me at how to do this.
Is there a way to have all the items output from the style sheet appear
as a single line with no return chars?? When executing the following
style sheet, how can I concatenate the values together in a single
line, in this case a single line would be how the browser displays
this, but I want the general text output to be a single line as well.
Basically is there a way to have all these lines concatenated together
when being outputted by the style sheetinstead of having a return
character after each line? Also, is there a way to have the xslt know
to not produce the last pipe on the line??? Maybe some type of
following-sibling??
Thanks in advance for your help. I appreciate it.
Desired Ouptput (note last data element does not have pipe)
================
<html xmlns:rep="http://localhost:7001/reporting"><body><table
border="0"><tr><td>11006732.908899993|</td><td>7941634.67709|</td><td>3065098.23181004|</td><td>3065098.23181004|</td><td>11006732.908899993</td></tr></table></body></html>
The output I am getting
( returns in output and last data element does have pipe)
=======================
$ test_XSLT.pl ( this is just my perl code that translates XSLT)
<html xmlns:rep="http://localhost:7001/reporting"><body><table
border="0"><tr>
<td>11006732.908899993|</td>
<td>7941634.67709|</td>
<td>3065098.23181004|</td>
<td>3065098.23181004|</td>
<td>11006732.908899993|</td>
</tr></table></body></html>
END OF TEST ./test_XSLT.pl
Style sheet below
==================
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rep="http://localhost:7001/reporting">
<xsl:template match="/">
<html>
<body>
<table border="0">
<tr>
<xsl:apply-templates
select="/rep:FrontPage/rep:frontPageSection/rep:sectionLine"/>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template
match="/rep:FrontPage/rep:frontPageSection/rep:sectionLine">
<xsl:apply-templates select="rep:lineName[starts-with(text(),'MARGIN
EQUITY')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'HOUSE
REQUIREMENTS')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'HOUSE
MARGIN EXCESS/DEFICIT')]"/>
<xsl:apply-templates select="rep:lineName[starts-with(text(),'CASH
AVAILABLE')]"/>
</xsl:template>
<!-- MARGIN EQUITY -->
<xsl:template match="rep:lineName[starts-with(text(),'MARGIN
EQUITY')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- HOUSE REQUIREMENTS-->
<xsl:template match="rep:lineName[starts-with(text(),'HOUSE
REQUIREMENTS')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- HOUSE MARGIN EXCESS DEFICIT -->
<xsl:template match="rep:lineName[starts-with(text(),'HOUSE MARGIN
EXCESS/DEFICIT')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
<!-- CASH AVAILABLE -->
<xsl:template match="rep:lineName[starts-with(text(),'CASH
AVAILABLE')]">
<td> <xsl:value-of select="../rep:amountAtDate[text()]"/>
<xsl:text>|</xsl:text></td>
</xsl:template>
</xsl:stylesheet>
Data Snippet
=============
<rep:FrontPage xmlns:rep="http://localhost:7001/reporting">
<rep:dateGenerated q="1">Fri Apr 1 14:49:29 2005</rep:dateGenerated>
<rep:dateGeneratedTimeZone q="1">Eastern Standard Time
(US/Eastern)</rep:dateGeneratedTimeZone>
<rep:date q="1">2005-03-31-05:00</rep:date>
<repreviousDate q="1">2005-03-30-05:00</repreviousDate>
<rep:frontPageSection>
<rep:sectionName q="1">GLOBAL MARGIN ROLL-UP (USD)</rep:sectionName>
<rep:sectionLine>
<rep:lineName q="1">MARGIN EQUITY</rep:lineName>
<rep:amountAtDate q="0">11006732.908899993</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.0115977892</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">HOUSE REQUIREMENTS</rep:lineName>
<rep:amountAtDate q="0">7941634.67709</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">HOUSE MARGIN EXCESS/DEFICIT</rep:lineName>
<rep:amountAtDate q="0">3065098.23181004</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.011597789</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">CASH AVAILABLE</rep:lineName>
<rep:amountAtDate q="0">3065098.23181004</rep:amountAtDate>
<rep:amountAtPreviousDate
q="0">-539473.011597789</rep:amountAtPreviousDate>
</rep:sectionLine>
</rep:frontPageSection>
<rep:frontPageSection>
<rep:sectionName q="1">US COMBINED MARGIN PB </rep:sectionName>
<rep:sectionLine>
<rep:lineName q="1">LONG MARKET VALUE</rep:lineName>
<rep:amountAtDate q="0">91617178.1389</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">SHORT MARKET VALUE</rep:lineName>
<rep:amountAtDate q="0">-5365772.36</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">CASH BALANCE CR (DR)</rep:lineName>
<rep:amountAtDate q="0">-75857105.73</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">BOND ACCRUED INTEREST</rep:lineName>
<rep:amountAtDate q="0">612432.86</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">REG U EXCESS/DEFICIT</rep:lineName>
</rep:sectionLine>
<rep:sectionLine>
<rep:lineName q="1">MARGIN EQUITY</rep:lineName>
<rep:amountAtDate q="0">11006732.908899993</rep:amountAtDate>
<rep:amountAtPreviousDate q="0">0</rep:amountAtPreviousDate>
</rep:sectionLine>
</rep:frontPageSection>