1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4<xsl:output method="html"/> 5<xsl:template match="doc"> 6 <doc> 7 <xsl:for-each select="date"> 8 <xsl:variable name="Day" select="substring-before(.,' ')"/> 9 <xsl:variable name="Month" select="substring-before(normalize-space(substring-after(., $Day)),' ')"/> 10 <xsl:variable name="Year" select="normalize-space(substring-after(., $Month))"/> 11 <date orginal="{.}"> 12 <day><xsl:value-of select="$Day"/></day> 13 <xsl:choose> 14 <xsl:when test="$Month='January'"><month>1</month></xsl:when> 15 <xsl:when test="$Month='February'"><month>2</month></xsl:when> 16 <xsl:when test="$Month='March'"><month>3</month></xsl:when> 17 <xsl:when test="$Month='April'"><month>4</month></xsl:when> 18 <xsl:when test="$Month='May'"><month>5</month></xsl:when> 19 <xsl:when test="$Month='June'"><month>6</month></xsl:when> 20 <xsl:when test="$Month='July'"><month>7</month></xsl:when> 21 <xsl:when test="$Month='August'"><month>8</month></xsl:when> 22 <xsl:when test="$Month='September'"><month>9</month></xsl:when> 23 <xsl:when test="$Month='October'"><month>10</month></xsl:when> 24 <xsl:when test="$Month='November'"><month>11</month></xsl:when> 25 <xsl:when test="$Month='December'"><month>12</month></xsl:when> 26 </xsl:choose> 27 <year><xsl:value-of select="$Year"/></year> 28 </date> 29 </xsl:for-each> 30 </doc> 31</xsl:template> 32 33 34 <!-- 35 * Licensed to the Apache Software Foundation (ASF) under one 36 * or more contributor license agreements. See the NOTICE file 37 * distributed with this work for additional information 38 * regarding copyright ownership. The ASF licenses this file 39 * to you under the Apache License, Version 2.0 (the "License"); 40 * you may not use this file except in compliance with the License. 41 * You may obtain a copy of the License at 42 * 43 * http://www.apache.org/licenses/LICENSE-2.0 44 * 45 * Unless required by applicable law or agreed to in writing, software 46 * distributed under the License is distributed on an "AS IS" BASIS, 47 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 48 * See the License for the specific language governing permissions and 49 * limitations under the License. 50 --> 51 52</xsl:stylesheet> 53