Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2006, 06:41 AM
Authorized User
 
Join Date: Apr 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default General data formatting

Using XSLT to convert one XML file to another, I need to do a bit of data re-formatting such as:

- converting dates from one format to another (yyyymmdd to dd mmmmm yyy)
- unpacking delimited text
- reformating names from SMITH/JOHNMR to separate tags
etc.

Whats the best way of doing this type of thing? I know that I can use (or try to!) Concat & Substring functions for the basic ones. Is it with scripts?

Any advice would be grateful.

Thanks in advance:)

 
Old April 26th, 2006, 06:53 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT 2.0 is much stronger for string manipulation, as it supports regular expressions.

In 1.0 you have to make do with functions such as substring-before, concat, etc. But you can do quite a lot with them, especially if used with recursive templates.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting data skrj02 Access 1 December 23rd, 2006 03:35 PM
formatting data skrj02 Access 2 December 22nd, 2006 12:27 PM
General formatting problem...... mike_remember ASP.NET 1.x and 2.0 Application Design 1 October 5th, 2004 09:18 AM
Formatting data in MsFlexGrid - How ? mike123abc Pro VB 6 2 January 8th, 2004 11:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.