|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to fuzz the last four digits of a lat/long?
Hi Folks,
I want to transform this location data:
<location>
<altitude>30000</altitude>
<latitude>42.364978</latitude>
<longitude>-71.022362</longitude>
</location>
to this:
<location>
<altitude>30000</altitude>
<latitude>42.360000</latitude>
<longitude>-71.020000</longitude>
</location>
That is, I want to map the altitude value directly and for the latitude and
longitude values I want to fuzz them by setting their last four digits to
zero.
I can do the latitude transformation in two steps:
1. Use format-number() to truncate the number to two digits to the right of
the decimal point.
2. Use concat() to append '0000'.
That is:
<latitude>
<xsl:value-of select="concat(format-number(latitude, '0.00'), '0000')" />
</latitude>
But, but, but, ....
I really want to do the transformation in one step. Is there a way to do the
transformation in one step (using the built-in XSLT or XPath functions)? As
best I can tell, I can't do it in one step using the format-number() function,
right?
Ditto for the longitude transformation.
/Roger
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








