|
|
|
|
SlashPane is a customized pane for the Visual FoxPro 8.0 Task Pane. It uses SlashDot's XML headline feature and XSLT to create an HTML page within the Task Pane. To install SlashPane, first unzip the download. Then open the Task Pane and click on Options. On the left side of the screen, click on Task Pane Manager, and then Customize. Next, click the Install Pane button on the right side of the screen and select the Slashpane.xml file. The SlashPane will then be available, and you can choose it from the button bar at the top of the Task Pane. To create the SlashPane, I started by clicking Customize Panes instead of Install Pane, as above. I then created a new pane of type HTML. (Note: these shots were taken after creating the pane, so there may be some differences when you do it.)
This set up the basics, so I next went to the Data tab, and told the pane where it should be looking.
Transform Data was a bit more tricky. I didn't know much about XSLT, so I went to http://www.w3.org/Style/XSL in the hopes of finding a clue. I was in luck. After reading through the specs for XSLT 1.0, and trying things repeatedly until I could get them to work, I came up with the transform on the next tab.
One of the things that gave me trouble at first was that for every HTML tag I opened, there had to be a closing one. Most browsers are forgiving about this, especially for tags like </TR> and </TD>, but the parser which VFP is using needs all t's dotted and i's crossed. You'll notice that sometimes I refer to the XML nodes (<tag>data</tag> being the simplest form) with curly brackets, and sometimes with a full xsl:value-of directive. This is a matter of context: since you can't nest one tag inside another, you can't put the xsl directive in an Anchor tag, for example. If you try to put the curly brackets somewhere where you can use the directive, all you get in your page is "{tag}". I decided to highlight any stories which had over 400 comments by turning the comment count red. The following code shows how I did this. <TD> <xsl:if test="comments > 400"> <xsl:attribute name="style">color:red</xsl:attribute> </xsl:if> <xsl:value-of select="comments"/></TD>
After this, I just chose the file name to save it to, and it created the XML file you installed at the top of the page.
For more information about working with the Task Pane, see Beth Massi's whitepaper, Inside the Visual FoxPro 8.0 Task Pane Manager, available in the MSDN Library. |
|
Send mail to
webmaster@donnael.com with
questions or comments about this web site.
|