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
Brian NewmanSubject: Standardizing IP addresses
Author: Brian Newman
Date: 02 Dec 2009 06:36 PM
I've got a requirement to standardize IP addresses.
I need to strip leading zeroes from each octet.
So, 001.010.100.000
becomes
1.10.100.0
I am developing in .NET framework and my XML processor is XmlCompiledTransform (so, I'm limited to Xslt 1.0/XPath 1.0).
Has anyone done this kind of thing before? Is there an elegant solution or just one very very ugly hack?

Posttop
Alberto MassariSubject: Standardizing IP addresses
Author: Alberto Massari
Date: 03 Dec 2009 10:38 AM
Hi Brian,
basically you should use substring-after and substring-before to isolate the substrings between dots, and then build the new string by processing those part with string(number(str))

Alberto

 
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.