SV: [jdom-interest] Creating an Element of type Date

Per Norrman pernorrman at telia.com
Thu Jan 22 02:13:15 PST 2004


Hi,

The xs:date datatype (I presume it is the XML Schema primitive datatype
defined 
here: http://www.w3.org/TR/xmlschema-2/#date) requires a date value as 
defined in ISO 8601, i.e. today would be 2004-01-22. There can also be
constraints 
on the date value (min, max, enumerated, etc).

For example:
   DateFormat df = new SimpleDateFormat("yyyy-MM-DD");
   Element d = new Element("Date");
   d.setText(df.format(new Date()));

/pmn

-----Ursprungligt meddelande-----
Från: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
För Moipone Mocoancoeng
Skickat: den 22 januari 2004 09:02
Till: jdom-interest at jdom.org
Ämne: [jdom-interest] Creating an Element of type Date


Hi All,
I have created a doc where I create and Element Date, when I insert the
document into Tamino I get the error "datatype validation for element
"Date" of type xs:date failed:".
How do I create an Element of type date?
Best Regards






Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!




More information about the jdom-interest mailing list