Click to See Complete Forum and Search --> : How to add date into XML and format columns?


toplisek
07-03-2008, 05:08 AM
I have XML like:
<item>
<title>Mytitle</title>
<link>http://www.mydomain.com</link>
<description>Text description1</description>
</item>

I would like to add date to this that it will be date like:
07.12.2009 title with URL
Description

How can be this achieved?

bogocles
07-03-2008, 02:18 PM
Are you trying to achieve this in an XSL transformation?
Is this data going to be sent by a web server?
Do you need the data dynamically added, or do you want the original XML changed?

toplisek
07-03-2008, 02:58 PM
1. Are you trying to achieve this in an XSL transformation?
2. Is this data going to be sent by a web server?
3. Do you need the data dynamically added, or do you want the original XML changed?

1. What would be achieved with XSL transformation? New to this...
2. and 3. simple change static of XML file to be shown also date but in format design as posted (space between date and other values)

bogocles
07-03-2008, 03:53 PM
Still not entirely sure what you want, but ...

For a static change, just do, for each entry, something like:


<item>
<date>07.12.2009</date>
<title>Mytitle</title>
<link>http://www.mydomain.com</link>
<description>Text description1</description>
</item>


To format this in any way, though, you're going to at least need to use a CSS or even some XSL, though you might not get any spacing with just CSS, unless you use some of the really obscure rules.

toplisek
07-07-2008, 11:39 AM
How to format XML with XSL to put space between Date and title and under this title is <description>Text description1</description>

bogocles
07-08-2008, 03:31 PM
Without getting into a lengthy code sample, I would just recommend checking out:

http://www.w3schools.com/xsl/default.asp