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

Re: Use of variables

Subject: Re: Use of variables
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 4 Jul 2000 19:01:34 +0100 (BST)
java variable reuse
 
 <xsl:variable name="ridval"  select="substring-after('aff',$ridsval)"

You probably want the arguments to substring-after in the other order.

   <xsl:attribute name="{$ridval}">RID VAL</xsl:attribute>
xsl:attribute can only add attribute nodes if no child nodes of the
current element have been added. Ie typically it has to come immediately
after the opening of an xsl:element, an xsl:copy or a literal result
element. You have it at the top level of the author template, which
might possibly work for one author, but not its siblings. If you
uncomment the xsl:element it can't work as then the xsl:element will
have added a child node.
 
> <xsl:variable name="ridsval" select="@rids[(letter+ digit+)]" />

No regexp in xslt.
You could use an extension function to use java regexp library, in which
case
it would look something like
<xsl:variable name="ridsval" select="@rids[myfun:foo(.)]" 

where myfun is the java extension namespace for your system and foo() is
a java function that accepts a node set and returns true if its string
value matches the regexp that you want to test. (Someone else will have
to provide the function:-)

David


 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.