Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to create/format an xsl output

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to create/format an xsl output
 Login/Join
 
Platinum Member
posted
This should be easy, but it isn't working. I apparently developed a brain cramp.

I thought I could just create a define field for the text, then concatenate the field to it and whala it would be done.

What this is, is to create these 3 lines for every fund code and its decription; such as PELL, PELL GRANT; STAFFORD, Stafford Loan, in the example.

It appears that the 'special characters' like <, $, =, ', " are causing problems. I've tried HEXBYT

I know the sample code isn't what I need but I am just trying to get over the hump. The first LINE3 define works, the next 2 do not. LINE3 prints out as blank, with no error messages.

All I want is a listing for every FUND code in this format, then we can copy and paste it into the xsl file

  
         <xsl:when test="$sCode='PELL'">
                               Pell Grant
               </xsl:when>
               <xsl:when test="$sCode='STAFFORD'">
                               Stafford Loan
               </xsl:when>




-* THIS IS WHAT I WANT AS OUPUT
-*              <xsl:when test="$sCode='PELL'">
-*                               Pell Grant
-*               </xsl:when>
-*
DEFINE FILE RFRBASE
DSIGN/A1  = HEXBYT(36, 'A1');
DQUOTE/A1 = HEXBYT(34, 'A1');
LTSIGN/A1 = HEXBYT(60, 'A1');
GTSIGN/A1 = HEXBYT(62, 'A1');
TXT1/A20 WITH RFRBASE_FUND_CODE = 'xslwhen test';
LINE3/A50 = LTSIGN || GTSIGN | RFRBASE_FUND_CODE || GTSIGN ;
-*LINE3/A50 = LTSIGN || TXT1 | RFRBASE_FUND_CODE || GTSIGN ;
-*LINE3/A50 = LTSIGN | /xsl:when | GTSIGN;
END
-*
TABLE FILE RFRBASE
PRINT RFRBASE_FUND_CODE NOPRINT
RFRBASE_FUND_TITLE
LINE3
WHERE RFRBASE_ACTIVE_IND EQ 'Y'
BY RFRBASE_FUND_CODE NOPRINT
IF RECORDLIMIT EQ 10
END

I foundout that an xsl file is an XML type file. So the section of an xsl file that I am trying to create is below. Maybe there is a way to generate it using WebFOCUS. I can create an XML output but that isn't exactly what I need becuse the FUND CODE, TITLE is in an choose clause.

[CODE]
<xsl:choose>
               <xsl:when test="$sCode='PELL'">
                               Pell Grant
               </xsl:when>
               <xsl:when test="$sCode='STAFFORD'">
                               Stafford Loan
               </xsl:when>
               <xsl:when test="$sCode='FULLTIME'">
                               Full Time
               </xsl:when>
               <xsl:otherwise>
                               <xsl:value-of select="$sCode" />
               </xsl:otherwise>
</xsl:choose>

  

[/code]

This message has been edited. Last edited by: Rick Man,


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Expert
posted Hide Post
How about this....

TABLE FILE COURSE
SUM COMPUTE LSTCODE/I9 = CNT.COURSECODE ; NOPRINT
PRINT 
COMPUTE CNTR/I9     = LAST CNTR + 1 ; NOPRINT
COMPUTE STRTXSL/A15 = IF CNTR EQ 1 THEN '<xsl:choose>' ELSE ' ' ;
COMPUTE XSLWHEN/A80 = '<xsl:when test="$sCode=''' || COURSECODE || '''">' || CTITLE || '</xsl:when>' ;
COMPUTE XSLELSE/A76 = IF LSTCODE EQ CNTR THEN '<xsl:otherwise><xsl:value-of select="$sCode" /></xsl:otherwise></xsl:choose>' ELSE ' ' ;
BY COURSECODE NOPRINT

WHERE RECORDLIMIT EQ 3

ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TESTXSL

END

-RUN

! type testxsl.ftm


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
WOW that's awesome. Thank you very much.
For my edification, the main issue was just the correct number of single quotes, right?
Nice technique to remember to only put out that first 'choose' tag.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Expert
posted Hide Post
If you need the xsl formatted the same as your example, then this can be done as well, with PUTDDREC.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Thanks Waz


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to create/format an xsl output

Copyright © 1996-2020 Information Builders