[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Conditional & Preceding-sibling

Subject: Re: Conditional & Preceding-sibling
From: Lee Goddard <home@xxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2000 13:34:33 +0100
preceding sibling xsl value of
Sorry for the bulk of this post.

> Can you post a test
> case that shows what it isn't working with?

Many thanks for your help, Jeni. Details below.
I've cut most of the stylesheet, but think 
what's there should work.

Again, many thanks
lee

--- Output ---


V1: <mor cd plur two> ==   "<morr4>" rez
       <mor cd plur three> ==   "<morr4>" ront. 
V7: <mor r1> ==   "<morroot-part1>" 2 "<morroot-part2>" 
V7: <mor r2> ==   "<morroot-part1>" 1 "<morroot-part2>" . 

--- XML Test File ---

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="d:/DATR/XSLT/dtrHTML.xsl" ?>
<DATR>
<EQUATION node="V1" path="mor cd plur two" relationship="EQUALS">
<QUOTEDPATH><ATOM value="mor"/><ATOM value="r4"/></QUOTEDPATH><ATOM value="rez"/></EQUATION>
<EQUATION node="V1" path="mor cd plur three" relationship="EQUALS">
<QUOTEDPATH><ATOM value="mor"/><ATOM value="r4"/></QUOTEDPATH><ATOM value="ront"/></EQUATION>
<EQUATION node="V7" path="mor r1" relationship="EQUALS">
<QUOTEDPATH><ATOM value="mor"/><ATOM value="root-part1"/></QUOTEDPATH><ATOM value="2"/><QUOTEDPATH><ATOM value="mor"/><ATOM value="root-part2"/></QUOTEDPATH></EQUATION>
<EQUATION node="V7" path="mor r2" relationship="EQUALS">
<QUOTEDPATH><ATOM value="mor"/><ATOM value="root-part1"/></QUOTEDPATH><ATOM value="1"/><QUOTEDPATH><ATOM value="mor"/><ATOM value="root-part2"/></QUOTEDPATH></EQUATION>
</DATR>



--- stylesheet ---

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- <xsl:output method="text"/> -->
<xsl:template match="DATR">
		<TT>
		<xsl:apply-templates/>
		</TT>
		<BR/>
		<HR size="1" color="teal"/>
		<FONT size="2" face="Lucinda, Verdana, Helvectia, Arial, Sans-serif">
		Produced from DATR XML by DATR dtrHTML.xls version 0.11<BR/>
		</FONT>
</xsl:template>

<xsl:template match="*">
	<xsl:apply-templates select="*"></xsl:apply-templates>
</xsl:template>


<!-- DATR definition/equation elements -->

<xsl:template match="EQUATION">
	<!--Concatonate GROUPS of nodedefs for DATR shorthand:
	dp NOT form a union of set (cf. geraldg 06/07/00; Kay p.551),
	Only print an element's "name" attribute if the previous
	element has different "name" attribute; otherwise indent.
	Thanks to Mike Kay and Ken Holman. -->

		PRE:<xsl:value-of select="preceding-sibling::*[@node][1]/@node"></xsl:value-of><BR/>
		This:<xsl:value-of select="@node"/><BR/>
		POS:<xsl:value-of select="following-sibling::*[@node][1]/@node"></xsl:value-of><BR/>

   	<xsl:choose>
		<xsl:when test="not(@node = preceding-sibling::*[@node][1]/@node )">
			<B>
			<xsl:value-of select="@node"/>:
			</B>
		</xsl:when>
		<xsl:otherwise>
			&#160;&#160;&#160;&#160;&#160;&#160;
		</xsl:otherwise>
	</xsl:choose>
	<FONT color="olive">
	&lt;<xsl:value-of select="@path"/>&gt;
	</FONT>
	<xsl:if test="@relationship[.='EQUALS']">==</xsl:if>
	<xsl:if test="@relationship[.!='EQUALS']">=</xsl:if>
	&#160;
	<xsl:apply-templates select="*"/>
   	<xsl:if test="not(@node = following-sibling::*[@node][1]/@node)">
		<!-- end the clause -->.
	</xsl:if>
	<BR/>
</xsl:template>


</xsl:stylesheet>



[end of post]


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.