If you're not up to speed with XML, stop by the W3 Schools site and brush up on XSL/XSLT and XPath. Next, get yourself a couple good tools. You'll need your favorite text editor and something to evaluate the XML DOM and to help with XPath. I use the DOM Inspector inside FireFox, and the XPather Browser FireFox add-on. In this particular example I pulled out view design objects using Domino Designer and exported them to DXL. (I also have Ytria's ScanEZ which makes DXL exporting easy too.)
Once you have your XML, you need to open it up in your favorite text editor. Remove the xmlns attribute name/value pair from the database tag (this confuses the stylesheet transformation for some reason). Add in the XML stylesheet refrence:
<?xml-stylesheet type="text/xsl" href="ColFormulas.xsl"?>right after the top tag. Now all you need is the stylesheet. Here's the one I used:
<?xml version="1.0" encoding="ISO-8859-1"?>Save both the files and open up the DXL file in FireFox. You should see a nice HTML page listing all your views with their selection formulas and underneath them a listing of all the columns and their formulas.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2><xsl:value-of select="database/@title"/> Column Formulas</h2>
<table border="1" width="500">
<tr bgcolor="#9acd32">
<th align="left" >Column Header</th>
<th align="left" >Formula</th>
</tr>
<xsl:for-each select="/database/view">
<tr bgcolor="#eaeaea">
<td colspan="2"><b><xsl:value-of select="@name"/></b>; Selection Formula: <xsl:value-of select="code/formula"/></td>
</tr>
<xsl:for-each select="column">
<tr>
<td><xsl:value-of select="columnheader/@title"/></td>
<td><xsl:value-of select="code/formula"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

0 comments:
Post a Comment