xsl-list
[Top] [All Lists]

[xsl] How to date type conversion between xml and Java

2010-08-13 09:18:09
Hi All,
 
I need some advice on how to store the following date value from a xhtml 
document using JPA:
     <strong>Time:</strong> 
      <time>13/08/2010 00:10:19 am</time> 
  </p>
 
There is no problem retrieving this value using XPath query. However, the value 
returned is of type string yet JPA (futureStock.setCollectionTime()) expects 
type java.util.Date such as the following code snippet:
 
    org.jdom.Element collection_time = 
((org.jdom.Element)time_element).getChild("time");
    futureStock.setCollectionTime(collection_time.getTextNormalize());
 
I would like to be in a position to retrieve both date and time separately at a 
later stage.
 
Any idea on how to overcome this issue? 
Thanks a lot,
Jack-<p>  
P.S. Apologies for asking Java type of question in an xslt forum but thought I 
try anyway since I am developing Java EE 5 development which consists of both 
technologies.


      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] How to date type conversion between xml and Java, Jack Bush <=