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 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Manikandan SurendranathSubject: Regex replace
Author: Manikandan Surendranath
Date: 18 May 2005 01:10 PM
Hi,

Recently I learnt that there is no processor independant replace() function avaliable in xslt, though the specification says so. Therefore I think regex will not be available too. Here is a solution I am looking for, I want to search a number followed by one or more whitespace and then a unit of measurement, like '9 mm' and output it to be '9 mm'. Can somebody guide me to do this?

Thanks

Postnext
(Deleted User) Subject: Regex replace
Author: (Deleted User)
Date: 19 May 2005 04:16 PM
Hi,
the reason why there is no processor independent replace() function is because the XSLT 1.0 specs do not specify such a function. Maybe you are referring to the EXSLT extension library (http://www.exslt.org), but that's a "community initiative", not a standard.
If you are looking for a processor independent way of doing a regex-based replace you should consider moving to XSLT 2.0, that has the fn:replace() function.

Hope this helps,
Alberto

Postnext
Manikandan SurendranathSubject: Regex replace
Author: Manikandan Surendranath
Date: 20 May 2005 12:48 AM
What should I be doing for that. Below is my style sheet declaration. I think I am using XSLT 2.0. Am I not?

<xsl:stylesheet xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="xlink" version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

The processors I am using is Saxon 6.5 & MSXSL 4.0 and client is using Saxon 7 & MS .NET v1.1 XSLT processor (XLST version 1.0 compatibility).

Postnext
Ivan PedruzziSubject: Regex replace
Author: Ivan Pedruzzi
Date: 20 May 2005 01:09 AM
Yes your XSLT is marked 2.0.
The only XSLT 2.0 processor available today is Saxon 8.x.

If you don't have control on which processor your clients run you have to stick with 1.0 and its restrictions.

Hope this helps
Ivan


Posttop
Manikandan SurendranathSubject: Regex replace
Author: Manikandan Surendranath
Date: 20 May 2005 01:55 AM
Well thanks. I'll scribble some workarounds then.

 
Topic Page 1 2 3 4 5 6 7 8 9 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.