• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Storing a date field as String sung XSLT

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I'm trying to do:
1. I am getting XML from a mainframe, and I am not sure how if it is coming as date field or simply as a text.
2. I am using XSL to fuse with the XML and provide HTML.
3. The date field is in the form of 10/31/2001 etc.
4. The problem is that when I try to read this date field, it gives actually thinks it is a numeric division and gives me a decimal number instead of reading it as a string.
5. This is the statement I am using in the XSL document
<td width="106"><b>Effective Date</b></td>
<td width="222"><xsl:value-of select="string(EFF-DAT)"/></td><td width="17"></td>
6. This is the function call that I am using to access the date (where the problem occurs)...
<a href="javascript:executeMDSA({TRN-COD}, 70, String({EFF-DAT})....
It reads the EFF-DAT field as a numeric field, eventhough I have typecasted it as a string. Please let me know how I can read the date field as a string field!!! Maybe some change to the XSL
Thanks in advance.
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex, will this work?
<a href="javascript:executeMDSA({TRN-COD}, 70, '{EFF-DAT}')">
(single quotes around {EFF-DAT})

[This message has been edited by Mapraputa Is (edited April 03, 2001).]
 
Alex Iordache
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it woks. Thx.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!