E N D
1. XML/XSLT Letters Andy Hemmins
University of Mississippi
ahemmins@olemiss.edu
2. July 2007 XML/XSLT Letter Generation 2
Developed by Meiying Yang
3. July 2007 XML/XSLT Letter Generation 3 What is XML and XSL? XML – eXtensible Mark-up Languagea mark-up language allowing industry-standard and user-defined tags
XSL – eXtensible Stylesheet Languagea group of transformation languages describing how an XML document can be formatted and transformed
4. July 2007 XML/XSLT Letter Generation 4 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
5. July 2007 XML/XSLT Letter Generation 5 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
6. July 2007 XML/XSLT Letter Generation 6 Create SAMU41 key file
GRP: AWLRS2 12 SEND FIRST AWARD LETTER C: C FP: N LTR: AL2 CON:
SLCT WAIDID SM& E005 E015
SLCT WTOTOFFR GT& 00000000
SLCT WREVREAS EQ& 99
SLCT SPACDLVL EQ& 01
SLCT S&LCODE NE AL2
7. July 2007 XML/XSLT Letter Generation 7 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
8. July 2007 XML/XSLT Letter Generation 8 AL2 Letter Code ===== * * * Top of File * * *
===== FILSEQ TBSW7
===== <student>
===== <sid> %SID </sid>
===== <first_name> %SNAME%F </first_name>
===== <last_name> %SNAME%L </last_name>
===== <residency> %SSTATE </residency>
===== <address>
===== <street1> %ADDR </street1>
===== <street2> %ADDR2 </street2>
===== <city> %CITY </city>
===== <postal_state> %STATE </postal_state>
===== <zip> %ZIP </zip>
===== </address>
===== <sptal3> %SPTAL3 </sptal3>
===== <aidyr> %AIDYR </aidyr>
===== <awards>
===== #ALOI AIDID=E005,E015 TOTOFFRGT=0
===== </awards>
===== </student>
* * * Bottom of File * * * F = first name only
L = last name only
# = indicates optional text call
ALO = is name of letter code
I = include only the following aid ID
TOTOFFRGT=0 = include only awards with offer > 0F = first name only
L = last name only
# = indicates optional text call
ALO = is name of letter code
I = include only the following aid ID
TOTOFFRGT=0 = include only awards with offer > 0
9. July 2007 XML/XSLT Letter Generation 9 ALO Letter Code
===== * * * Top of File * * *
===== <award>
===== <aidid> %AIDID </aidid>
===== <title> %LDESC%24 </title>
===== <whole_summary>
===== <offer_amount> %TOTOFFR%08F </offer_amount>
===== </whole_summary>
===== </award>
* * * Bottom of File * * * 08 = 8 characters maximum
F = 2 decimal places, no commas inserted08 = 8 characters maximum
F = 2 decimal places, no commas inserted
10. July 2007 XML/XSLT Letter Generation 10 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
11. July 2007 XML/XSLT Letter Generation 11 SAMN25 Output <student>
<sid> 010189675 </sid>
<first_name> Lillian </first_name>
<last_name> Rogers </last_name>
<residency> MS </residency>
<address>
<street1> 198 Walter Lott Road </street1>
<street2> </street2>
<city> Seminary </city>
<postal_state> MS </postal_state>
<zip> 39479 </zip>
</address>
<sptal3> 1 </sptal3>
<aidyr> 2008 </aidyr>
<awards>
<award>
<aidid> E015 </aidid>
<title> Academic Excellence NMF </title>
<whole_summary>
<offer_amount> 5000.00 </offer_amount>
</whole_summary>
</award>
</awards>
</student> Normally left-justified
Mark-up language: “Lillian” is the text and “first_name” is the description of that textNormally left-justified
Mark-up language: “Lillian” is the text and “first_name” is the description of that text
12. July 2007 XML/XSLT Letter Generation 12 Prefix:
<student_info>
<todaydate>
today’s date goes here
</todaydate>
Suffix:
</student_info>
13. July 2007 XML/XSLT Letter Generation 13 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
14. July 2007 XML/XSLT Letter Generation 14 XSL Letter Template - header <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/student_info">{\rtf1\ansi\ansicpg1252\deff0\deflang2052{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;} {\f1\fnil\fcharset0 Times New Roman;}{\f2\fswiss\fcharset0 Arial;} {\f3\fnil\fcharset2 Symbol;}}{\*\generator Msftedit 5.41.15.1507;}{\info{\title Olemiss Scholarship Award Letter}{\author Meiying Yang} {\company The University of Mississippi}{\comment Revised 01-12-2006}} \margl1260 \margr1260\margt720\margb720\viewkind4\uc1\pard \nowidctlpar\f0\fs24
15. July 2007 XML/XSLT Letter Generation 15 XSL Letter Template – name & address <xsl:for-each select="student">
\fs22\par\par\par\par\par\par\par\par\par
<xsl:value-of select="normalize-space(/student_info/todaydate)"/> \par\par
<xsl:value-of select="normalize-space(first_name)"/> <xsl:text></xsl:text> <xsl:value-of select="normalize-space(last_name)"/>\par
<xsl:value-of select="normalize-space(descendant::street1)"/>\par
<xsl:if test="not(normalize-space(descendant::street2)='')">
<xsl:value-of select="normalize-space(descendant::street2)"/>\par
</xsl:if>
<xsl:value-of select="normalize-space(descendant::city)"/>, <xsl:value-of select="normalize-space(descendant::postal_state)"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space(descendant::zip)"/>\par\par
16. July 2007 XML/XSLT Letter Generation 16 XSL Letter Template - text Dear <xsl:value-of select="normalize-space(first_name)"/>:\par\par
Congratulations on your selection as a <xsl:if test="(normalize-space(descendant::sptal3)='3')">National Achievement Finalist.</xsl:if>
<xsl:if test="(normalize-space(descendant::sptal3)='4')">National Achievement Semi-Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1')">National Merit Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='2')">National Merit Semi-Finalist.</xsl:if> On behalf of the University's Committee on Student Financial Aid, I am pleased to award you a National <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='4')">Achievement</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1' or normalize-space(descendant::sptal3)='2')">Merit</xsl:if> Academic Excellence Scholarship for the 2007-2008 academic year. This scholarship is valued at $<xsl:value-of select="normalize-space(descendant::offer_amount)"/> and is renewable for three additional years contingent upon meeting the requirements of the associated terms and conditions. Your selection is indeed an outstanding honor and one of which you should be very proud.\par\par
17. July 2007 XML/XSLT Letter Generation 17 XSL Letter Template - text Dear <xsl:value-of select="normalize-space(first_name)"/>:\par\par
Congratulations on your selection as a <xsl:if test="(normalize-space(descendant::sptal3)='3')">National Achievement Finalist.</xsl:if>
<xsl:if test="(normalize-space(descendant::sptal3)='4')">National Achievement Semi-Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1')">National Merit Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='2')">National Merit Semi-Finalist.</xsl:if> On behalf of the University's Committee on Student Financial Aid, I am pleased to award you a National <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='4')">Achievement</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1' or normalize-space(descendant::sptal3)='2')">Merit</xsl:if> Academic Excellence Scholarship for the 2007-2008 academic year. This scholarship is valued at $<xsl:value-of select="normalize-space(descendant::offer_amount)"/> and is renewable for three additional years contingent upon meeting the requirements of the associated terms and conditions. Your selection is indeed an outstanding honor and one of which you should be very proud.\par\par
18. July 2007 XML/XSLT Letter Generation 18 XSL Letter Template - text Dear <xsl:value-of select="normalize-space(first_name)"/>:\par\par
Congratulations on your selection as a <xsl:if test="(normalize-space(descendant::sptal3)='3')">National Achievement Finalist.</xsl:if>
<xsl:if test="(normalize-space(descendant::sptal3)='4')">National Achievement Semi-Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1')">National Merit Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='2')">National Merit Semi-Finalist.</xsl:if> On behalf of the University's Committee on Student Financial Aid, I am pleased to award you a National <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='4')">Achievement</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1' or normalize-space(descendant::sptal3)='2')">Merit</xsl:if> Academic Excellence Scholarship for the 2007-2008 academic year. This scholarship is valued at $<xsl:value-of select="normalize-space(descendant::offer_amount)"/> and is renewable for three additional years contingent upon meeting the requirements of the associated terms and conditions. Your selection is indeed an outstanding honor and one of which you should be very proud.\par\par
19. July 2007 XML/XSLT Letter Generation 19 XSL Letter Template - text Dear <xsl:value-of select="normalize-space(first_name)"/>:\par\par
Congratulations on your selection as a <xsl:if test="(normalize-space(descendant::sptal3)='3')">National Achievement Finalist.</xsl:if>
<xsl:if test="(normalize-space(descendant::sptal3)='4')">National Achievement Semi-Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1')">National Merit Finalist.</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='2')">National Merit Semi-Finalist.</xsl:if> On behalf of the University's Committee on Student Financial Aid, I am pleased to award you a National <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='4')">Achievement</xsl:if><xsl:if test="(normalize-space(descendant::sptal3)='1' or normalize-space(descendant::sptal3)='2')">Merit</xsl:if> Academic Excellence Scholarship for the 2007-2008 academic year. This scholarship is valued at $<xsl:value-of select="normalize-space(descendant::offer_amount)"/> and is renewable for three additional years contingent upon meeting the requirements of the associated terms and conditions. Your selection is indeed an outstanding honor and one of which you should be very proud.\par\par
20. July 2007 XML/XSLT Letter Generation 20 XSL Letter Template – more text <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='1')">
<xsl:if test="(normalize-space(descendant::residency)='MS')">
In addition, if you accept the terms and conditions associated with your National <xsl:if test="(normalize-space(descendant::sptal3)='3')">Achievement</xsl:if> <xsl:if test="(normalize-space(descendant::sptal3)='1')">Merit</xsl:if> Academic Excellence Scholarship, you will receive the Luckyday Merit Scholarship valued at $3000 per year and housing scholarship valued at $3070 per year.\par\par
</xsl:if>
<xsl:if test="not (normalize-space(descendant::residency)='MS')">
In addition, if you accept the terms and conditions associated with your National <xsl:if test="(normalize-space(descendant::sptal3)='3')">Achievement</xsl:if> <xsl:if test="(normalize-space(descendant::sptal3)='1')">Merit</xsl:if> Academic Excellence Scholarship, you will receive a housing scholarship valued at $3070 per year and a full non-resident scholarship valued at $5964 per year.\par\par
</xsl:if>
21. July 2007 XML/XSLT Letter Generation 21 XSL Letter Template – more text <xsl:if test="(normalize-space(descendant::sptal3)='3' or normalize-space(descendant::sptal3)='1')">
<xsl:if test="(normalize-space(descendant::residency)='MS')">
In addition, if you accept the terms and conditions associated with your National <xsl:if test="(normalize-space(descendant::sptal3)='3')">Achievement</xsl:if> <xsl:if test="(normalize-space(descendant::sptal3)='1')">Merit</xsl:if> Academic Excellence Scholarship, you will receive the Luckyday Merit Scholarship valued at $3000 per year and housing scholarship valued at $3070 per year.\par\par
</xsl:if>
<xsl:if test="not (normalize-space(descendant::residency)='MS')">
In addition, if you accept the terms and conditions associated with your National <xsl:if test="(normalize-space(descendant::sptal3)='3')">Achievement</xsl:if> <xsl:if test="(normalize-space(descendant::sptal3)='1')">Merit</xsl:if> Academic Excellence Scholarship, you will receive a housing scholarship valued at $3070 per year and a full non-resident scholarship valued at $5964 per year.\par\par
</xsl:if>
22. July 2007 XML/XSLT Letter Generation 22 XSL Letter Template - trailer \par\par
Sincerely,
\par\par\par
\pard\nowidctlpar\tx1080\tx6840
Max R. Miller Jr. \par
Associate Director \par
Office of Admissions and Records \par
\pard\nowidctlpar\par
\sect\sectd\sbknone \marglsxn1260\margrsxn1260\margtsxn360\margbsxn720
\page
23. July 2007 XML/XSLT Letter Generation 23 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
24. July 2007 XML/XSLT Letter Generation 24 XML Document + XSLT template = .RTF Letter
org.apache.xalan.xslt.Process-IN XMLDocument-XSL XSLLetterTemplate-OUT Letter.rtf
Can be downloaded from xml.apache.org
Java or C++
25. July 2007 XML/XSLT Letter Generation 25 Letter Generation Process Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32Academic excellence packaging
E012 ACT 26 & 27
E007 28 & 29
E009 30 & 31
E006 >= 32
26. July 2007 XML/XSLT Letter Generation 26 The End Product July 20, 2007
Lillian Rogers
198 Walter Lott Road
Seminary, MS 39479
Dear Lillian:
Congratulations on your selection as a National Merit Finalist. On behalf of the University's Committee on
Student Financial Aid, I am pleased to award you a National Merit Academic Excellence Scholarship for the
2007-2008 academic year. This scholarship is valued at $5000.00 and is renewable for three additional years
contingent upon meeting the requirements of the associated terms and conditions. Your selection is indeed
an outstanding honor and one of which you should be very proud.
In addition, if you accept the terms and conditions associated with your National Merit Academic Excellence
Scholarship, you will receive the Luckyday Merit Scholarship valued at $3000 per year and housing
scholarship valued at $3070 per year.
[blah blah blah]
Sincerely,
Max R. Miller Jr.
Associate Director
Office of Admissions and Records Dynamic bits of the letter are highlightedDynamic bits of the letter are highlighted