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

RE:

Subject: RE:
From: "Harbarth, Juliane" <jhb@xxxxxxxxxxxxxx>
Date: Mon, 21 Jun 1999 13:08:37 +0200
b names unique

From: Eugeny Kuzakov [mailto:kev@xxxxxxxxx]

> Example of xml:
> ...
> What I want in output?
> 1. On each <document> I need output list of documents that reference ( in
<ticker>)
>     to this document.
> 2. On each <document> I need output list of <b>UNIQUE</b> names of
> documents to which this document reference.
>

After having completed your document with
	<?xml version='1.0'?>
	<documents>
	...
	</documents>
the follwing stylesheet converts it to a
HTML table containing each document including
the references from and towards it.
I used James Clark's XT. I would be grateful
for any advice on how to achieve this with a
shorter stylesheet (are four variables really
neccessary ?).

The stylesheet :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
	        xmlns="http://www.w3.org/TR/REC-html40"
	        result-ns="">

 	<xsl:template match="/">
 	 <HTML>
	  <HEAD>
	   <TITLE>Document References</TITLE>
	  </HEAD>
 	  <BODY>
	   <CENTER>
	    <TABLE border="1">
	     <xsl:apply-templates/> 
	    </TABLE> 
	   </CENTER>
 	  </BODY>
 	 </HTML>
 	</xsl:template>

    	<xsl:template match="document">
	 <TR valign="top">
	  <TD>
	   <xsl:value-of select="@name"/> / <xsl:value-of
select="@department"/>
	  </TD>
	  <TD>
	   <xsl:for-each select="ticker">
	    is referencing : <xsl:value-of select="@docrefto"/> /
<xsl:value-of select="@department"/>
	    <BR />
	   </xsl:for-each>
	   <BR />
	   <xsl:variable name="targetName"><xsl:value-of
select="@name"/></xsl:variable>
	   <xsl:variable name="targetDept"><xsl:value-of
select="@department"/></xsl:variable>
	   <xsl:for-each select="//document">
	    <xsl:variable name="sourceName"><xsl:value-of
select="@name"/></xsl:variable>
	    <xsl:variable name="sourceDept"><xsl:value-of
select="@department"/></xsl:variable>
	    <xsl:for-each select="ticker">
	     <xsl:if test="@docrefto=$targetName and
@department=$targetDept">
	      is referenced by : <xsl:value-of select="$sourceName"/> /
<xsl:value-of select="$sourceDept"/>
	      <BR />
	     </xsl:if>
	    </xsl:for-each>
	   </xsl:for-each>
	  </TD>
	 </TR>
    	</xsl:template>

    	<xsl:template match="text()">
         <xsl:value-of select="."/>
    	</xsl:template>	

</xsl:stylesheet>


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


Current Thread
  • RE:
    • Harbarth, Juliane - Mon, 21 Jun 1999 13:08:37 +0200 <=

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.