XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Miranda NewmanSubject: Year Calculation
Author: Miranda Newman
Date: 09 Feb 2007 11:03 AM
Hi everyone - I was hoping someone might know an answer to the problem I'm having. I'm a bit green at XSLT so I appreciate your patience. I have a form where the user enters a date into a date box. The output in the XML is MM/DD/YYYY. I want to take the year as a numeric amount and add 5 onto it so that the expiration year will print on the form five years from now. I could force users to enter the Month, day and year as separate fields and then add five onto the year entry, but I'd like to make it as easy for the users as possible. If anyone has any suggestions, I'd be very appreciative. Thanks in advance.

Posttop
Tony LavinioSubject: Year Calculation
Author: Tony Lavinio
Date: 09 Feb 2007 11:25 AM
You didn't us much to go on.
1. Which version of Stylus Studio are you using?
2. Which XSLT processor? Can you do XSLT 2.0?

Assuming, since this is the Stylus Studio support forum, that you
have our product, and that you are using XSLT 1.0, attached is a
solution for you. If you're not using Stylus Studio, why not? :)


Documentyears.xml
sample dates xml file

Documentyears.xsl
XSLT to add 5 to the year

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.