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

Substring Misunderstood?

Subject: Substring Misunderstood?
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Fri, 4 May 2001 01:35:05 -0700 (PDT)
xml stylesheet substring
Substring has two forms:

  substring(value,start)
  substring(value,start,length)

Your usage of <<substring($idvalue,1)>> is grabbing the whole
string. Since $idval is just the content of <id>,

  <xsl:variable name="idvalue" select="id"/>

what is the point of this processing?

Try the attached example and tie future questions to what a
realistic sample of the XML document you are processing looks 
like.

Regards,

Dan

File:Samways4May2001.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Samways4May2001.xsl"?>

<root>
 <employee>
  <id>1_1</id>
  <name>Susan</name>
 </employee>
 <employee>
  <id>1_2</id>
  <name>Mary</name>
 </employee>
</root>

File:Samways4May2001.xsl
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
 <xsl:template match="/">
  <xsl:apply-templates select="root"/>
 </xsl:template>
 
 <xsl:template match="root">
  <xsl:apply-templates select="employee"/>
 </xsl:template>
 
 <xsl:template match="employee">
  <div align="left">
   <xsl:value-of select="id"/> -
   <xsl:value-of select="name"/> - 
   <xsl:value-of select="position()"/>
  </div>
 </xsl:template>
   
</xsl:stylesheet>

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 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.