I. Introduction |
This project accomplishes the task of representing any Call Processing Language(CPL) document graphically in XHTML format. The resulting XHTML is generated by XSLT documents, which are the centerpieces of this project. As any CPL document, as it is an XML-based language, is comprised of groups of nodes, outputs, and parameters, XSL/XSLT is very effective in displaying the CPL documents in a "flowchart" manner which is representative of the actions to be performed by the CPL document. |
II. Structure of the XSLT Documents |
The
XSLT documents are based around two XSL templates that either call upon
each other, or upon themselves recursively to display each node, output
and parameter in the most sensible manner. In XSL/XSLT, templates are pieces
of XSL and sometimes HTML code which extract the appropriated information
from an XML document in order to restructure it into another form of XML.
In this project, that other form of XML is HTML and the resulting script
is considered XHTML. The two templates in the cpl_graphic.xsl document are:
|
III. A More In-depth Look |
-
When/If Conditional Statements Throughout the XSL document, I needed to use many test cases using the "when" and "if" clauses of XSLT. Both are the same except when using the "when" clause, you are telling the processor to only choose one case in the series and order, therefore, counts. When using if, all are tested. Here is a piece of code that uses both: <xsl:when test="name()='remove-location'"> ........ <xsl:if test="name(@location)='location'"> <br/> location : <span class="attr"> <xsl:value-of select="@location"/> </span> </xsl:if> Here we ask that when the name(name()) of the node is equivalent to "remove-location" to enter the next piece of code. Inside there, we ask if the name of the attribute(@) is location. If so, it will enter the following piece of code then continue. - Calling the generate template From the template that matches the "cpl" node in the XML document, we must call the generate template to perform all our node structuring. Here is the XSLT code: <xsl:for-each select="child::*"> <xsl:call-template name="generate"/> </xsl:for-each> What this code is doing is actually calling the generate template for all children nodes of the current one, which is Cpl. As a convention of CPL, every node is a child of the cpl node so we are calling it on all nodes in the XML document. - Filling in HTML attributes on the fly Rather than "hardcoding" all the attributes like colors and text properties into the XSL document, we can generate them on the fly so that in certain cases, table cells or certain words can be different colors or have different properties. Here is an example of how the table cells for the subaction node and sub pseudo-node get their tannish color rather than white: <td align="center" colspan="20" bgcolor="white" nowrap="true"> ............. <xsl:when test="name()='subaction'"> <xsl:attribute name="bgcolor">#EDEDC9</xsl:attribute> In this case, there is no "hardcoded""color" attribute for the td tag. The XSLT asks that when the name of the node is "subaction", that an attribute named "bgcolor" and having the value "#EDEDC9" be added to the resulting HTML document. The result will be: <td align="center" colspan="20" bgcolor="white" nowrap="true" bgcolor="#EDEDC9"> |
IV. Other Parts of the Project |
In
addition to the XSLT document that I created, there are a few other deeds
I had to accomplish to complete the project:
|
V. Documents and Contacts |
Contact Information Michael Medric - mfm18@columbia.edu Henning Schulzrinne - hgs@cs.columbia.edu Jonathan Lennox - lennox@cs.columbia.edu |