[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dateTime format string, Anyone developed an rng d
On 03/02/10 15:26, Syd Bauman wrote:
http://www.w3.org/TR/xslt20/#format-date defines format-dateTime( $value as xs:dateTime?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $country as xs:string?) as xs:string? The picture string is fairly regular. Has anyone produced a relaxng expression which captures it please? I took note from John Cowan that comments can be used Syd! I'm ignoring certain values (simplicity). So far I've generated <element name='doc'> <oneOrMore> <element name='dateTime'> <data type='string'> <param name='pattern'><!-- Year -->(\[Y(01|0001)?\][^\[]?)<!-- Month -->(\[M(1|01)?\]?[^\[]?)<!-- Day -->(\[D(1|01)?\])?<!-- Hour -->(T\[H[01]{0,2}\]:<!-- Minutes -->\[m(1|01)?\]:<!-- Seconds -->\[s(1|01)?\]\.<!-- decimal seconds -->\[f(1|01|001)?\])?</param> </data> </element> with test data of <doc> <dateTime>[Y0001]-[M01]-[D]</dateTime> <dateTime>[Y]@[M]@[D]</dateTime> <dateTime>[Y0001]-[M01]-[D1]</dateTime> <dateTime>[Y]-[M1]-[D1]</dateTime> <dateTime>[Y]-[M]-[D]T[H]:[m1]:[s].[f]</dateTime> <dateTime>[Y][M]-[D01]T[H01]:[m01]:[s01].[f001]</dateTime> <dateTime>[Y][M]-[D01]T[H01]:[m01]:[s01].[f001]</dateTime> <!-- Errors --> <dateTime>[Y100][M][D]T[H]:[m]:[s].[f]</dateTime> <dateTime>[Y][M100][D]T[H]:[m]:[s].[f]</dateTime> <dateTime>[Y][M][D10]T[H]:[m]:[s].[f]</dateTime> <dateTime>[Y][M][D10]T[H]:[m10]:[s].[f]</dateTime> <dateTime>[Y]-[M]-[D01]T[H01]:[m01]:[s0001].[f001]</dateTime> </doc> and exclusions of YWw for 'Two thousand and ten' MNn for December Dlo for 31st DWo for twentieth Its for a graph X axis, using dates. As you see, we only need the Y M D H m s parts which makes it a little easier. I thought someone may have done it already Thanks though. Appreciated. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
|
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
|