XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Greg HigginsSubject: Fun with Dick and Jane (Dick XML and Jane XSLT)
Author: Greg Higgins
Date: 26 Feb 2007 08:48 AM
Start with some well formed xml

<?xml version="1.0"?>
<lists>
<list
path="svn://xxx.yyy.com:abcd/techpapers/enginecrew">
<entry
kind="file">
<name>Exchange_06_OE_RDBMS_Tuning_03.pdf</name>
<size>2024229</size>
<commit
revision="4">
<author>greg_higgins</author>
<date>2007-02-09T18:53:04.418367Z</date>
</commit>
</entry>
<entry
kind="dir">
<name>monographs</name>
<commit
revision="9">
<author>greg_higgins</author>
<date>2007-02-09T19:14:44.225801Z</date>
</commit>
</entry>
<entry
kind="file">
<name>tuning_oe_rdbms_ex_06_final.pdf</name>
<size>222518</size>
<commit
revision="4">
<author>greg_higgins</author>
<date>2007-02-09T18:53:04.418367Z</date>
</commit>
</entry>
</list>
</lists>

add a stylesheet

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>

<xsl:variable name="fullpath" select="substring-after(/lists/list/@path,'svn://xxx.yyy.com:abcd/')" />

<xsl:template match="/">
<p>
<xsl:copy-of select="$fullpath" />
</p>
<p>
<xsl:apply-templates select="/lists/list/entry">
<xsl:sort select="./@kind" order="descending" data-type="text"/>
</xsl:apply-templates>
</p>

</xsl:template>

<xsl:template match="entry">
<div class="{@kind}">
<xsl:choose>
<xsl:when test="@kind = 'dir'">
<a href="http://xxx.yyy.com/yyysvn.cgi?/{$fullpath}{name}"><xsl:value-of select="name"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./name"/>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>

</xsl:stylesheet>

create a scenario using the xml

paste in the stylesheet

preview it, (I prefer text)

inadvertently click the wysiwyg tab.

just for the heck of it, while staying on the wysiwyg tab, preview it again.

Hmmmmm, wonder what happened.

Go back to XSLT source tab.

Hmmmm. wonder what happened.

Fun with Dick and Jane was provided by StylusStudio Enterprise Edition Build 734f with assistance from JVM 1.5.0_11-b03 Java HotSpot(TM) Client VM Sun Microsystems Inc running on MicroSoft Windows XP (sp2).

Posttop
Tony LavinioSubject: Fun with Dick and Jane (Dick XML and Jane XSLT)
Author: Tony Lavinio
Date: 26 Feb 2007 11:22 AM
Yeah, we aren't all that fond of WYSIWYG.
It works by putting the XML into Internet Explorer, and using
IE behaviors, and when you switch back we read the IE DOM swamp
and recreate the XSLT.
IE isn't always very nice to what it doesn't own.

In future versions of Stylus Studio, we're moving away from WYSIWYG
and instead leaning on the new XML Report module which does not
depend on IE.

The disadvantage is that it means we can't reverse-engineer XSLT to
get HTML out of it, but it has the considerable advantage in that we
can now generate PDFs as well as HTML. And we'll be supporting more
properties than we did in IE also. And it will support XQuery. I
guess that's more than one advantage.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.