xsl-list
[Top] [All Lists]

Re: Parsing day out of date format 10/12/00

2003-02-12 14:15:04
Hello.

If you are sure all your stuff is there, this could do it:

<xsl:template match="BirthDate">
  <BirthDate>
    <BirthMonth><xsl:value-of select="substring-before(.,'/')"/></BirthMonth>
    <BirthDay><xsl:value-of 
select="substring-before(substring-after(.,'/'),'/')"/></BirthDay>
    <BirthYear><xsl:value-of 
select="substring-after(substring-after(.,'/'),'/')"/></BirthYear>
  </BirthDate>
</xsl:template>

(could include any mistake, hope not)

<BirthDate>
  <BirthMonth>10</BirthMonth>
  <BirthDay>12</BirthDay>
  <BirthYear>00</BirthYear>
</BirthDate>

regards
-- 
José Esteban
Granada - Spain

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list