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

RE: Detecting a break in data

Subject: RE: Detecting a break in data
From: "Smith, Graham" <Graham.Smith@xxxxxxxxxx>
Date: Wed, 26 Jun 2002 03:50:25 -0400
smith graham
Thanks Tom, and all others that chipped in to help me out with this.  After
a little fiddling with the key to use a substring of a substring-after, and
figuring out how to use this on the match, and then nest a second key within
that, I have finally got the display I needed.  Unfortunately, it proved
that my data is unreliable in its content and needs a little more analysis
and perhaps pre-processing - but it was a valuable learning experience.  I
feel a little more confident that I understand the relationship between XML
and XSL now.
Regards,
Graham.

PS - here is my (perhaps) final code in case the use of the substring keys
is of any use to anyone

<xsl:key name="byRecType" match="MapRule"
use="substring(substring-after(objectset,':'),1,7)"/>
<xsl:key name="byFldType" match="MapRule"
use="substring-before(substring-after(objectset,' '),' ')"/>
<xsl:template match="/">

<html>
<body>
<h2>Mercator Map Rules</h2>
<xsl:for-each select="MMS">
<h3><xsl:value-of select="@path"/></h3>

<xsl:for-each select="Map">
<xsl:variable name="MapID" select="@name"/>
<h4>Mappings for: <xsl:value-of select="$MapID"/></h4>

<xsl:for-each select=".//MapRule[generate-id() = 
	
generate-id(key('byRecType',substring(substring-after(objectset,':'),1,7))
[1])]">
<xsl:for-each
select="key('byRecType',substring(substring-after(objectset,':'),1,7))">
					
<xsl:variable name="fldnm" select="substring-before(objectset,' ')"/>
<xsl:variable name="rest1" select="substring-after(objectset,' ')"/>
<xsl:variable name="fldtyp" select="substring-before($rest1,' ')"/>
<xsl:variable name="rest2" select="substring-after($rest1,':')"/>
<xsl:variable name="rectyp" select="substring-before($rest2,' ')"/>

Rule <xsl:value-of select="@rulenumber"/>:
<font size="-1" color="blue"><strong>

<xsl:choose>
<xsl:when test="string-length($fldnm) &lt; '1'">
<xsl:value-of select="objectset"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$fldnm"/> (
<xsl:value-of select="$fldtyp"/> in <xsl:value-of select="$rectyp"/>)
</xsl:otherwise>
</xsl:choose>

<xsl:value-of select="' = '"/>
<xsl:value-of select="substring-after(objectrule,'=')"/><BR/>
</strong></font>

</xsl:for-each>
<p/>
</xsl:for-each>
</xsl:for-each>
<p/>
</xsl:for-each>
</body>
</html>
</xsl:template>

 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.