Looking into Saxon code, I use this, and it seems to work correctly... in fact for formatting !

    public static String formatXsDateTime(Date date) {
        Calendar cal = GregorianCalendar.getInstance();
        DateTimeValue dtVal = new DateTimeValue(cal, true);
        return new StringBuilder(dtVal.getPrimitiveStringValue()).toString();

I think I can use DateTimeValue to parse, but it's going to be later...

Thanks a lot,

Le 14/06/2011 09:38, Alan Painter a écrit :


Yes, ran into that as well.

It's not pretty but you might get some use from this for formatting an xs:dateTime string:

SimpleDateFormat iso8601DateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");

Date myDateValue ...

String  =  iso8601DateTime.format(myDateValue);
String formatted = firstCut.substring(0,  firstCut.length()-2 + ":" + firstCut.substring(firstCut.length()-2);

Ugly stuff.  I would be happy to see something nicer.


On Jun 14, 2011 8:46 AM, "Christophe Marchand" <christophe.marchand@axyus.com> wrote:
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help