473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Current Date in XML

Hi Everyone,

I have XML file. It have some date to display the Graph. In that file i need to provide the date value. I would like to give the current date instead of hard coded date. I tried someways that i found in net , but no use of it. Can anyone help how to do this.


This is my XML file.

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" ?>
  2. <!-- created: Fri May  4 10:18:56 2007 -->
  3. <graph animation="1" bgColor="FFFFFF" canvasBgColor="FFFFFF" canvasbordercolor="CCCCCC" canvasborderthickness="1" canvasbgalpha="100" hovercapbgColor="FFFFFF" basefontcolor="000000" outcnvbasefontsize="10" areabordercolor="ffffff" hoverCapBorderColor="CCCCCC" PYAxisMinValue="0" numdivlines="4" divLineColor="FFFFFF" decimalPrecision="0" shownames="1" showAlternateHGridColor="1" alternateHGridColor="CCCCCC" showAlternateVGridColor="1" alternateVGridColor="CCCCCC" alternateVGridAlpha="80" showSecondaryLimits="1" showDivLineSecondaryValue="1" PYAxisName="" SYAxisName="" SYAxisMaxValue="420000" PYAxisMaxValue="420000" numVdivlines="10" formatNumberScale="1" showLegend="0" com_testing_caption="Potential Attacks By Category" com_testing_subcaption ="05-07 - 06-07" com_testing_changepct="-55.4%">
  4. <categories>
  5.     <category name="May"/>
  6.     <category name="Jun"/>
  7.     <category name="Jul"/>
  8.     <category name="Aug"/>
  9.     <category name="Sep"/>
  10.     <category name="Oct"/>
  11.     <category name="Nov"/>
  12.     <category name="Dec"/>
  13.     <category name="Jan"/>
  14.     <category name="Feb"/>
  15.     <category name="Mar"/>
  16.     <category name="Apr"/>
  17. </categories>
  18. <dataset color="000080" areaBorderColor="000080" seriesName="other-activity" showValues="0">
  19.     <set value="3598"/>
  20.     <set value="2626"/>
  21.     <set value="2174"/>
  22.     <set value="7109"/>
  23.     <set value="1154"/>
  24.     <set value="3150"/>
  25.     <set value="3391"/>
  26.     <set value="7208"/>
  27.     <set value="14767"/>
  28.     <set value="2312"/>
  29.     <set value="11950"/>
  30.     <set value="9084"/>
  31. </dataset>
  32. </graph>
  33.  

In the above code, i want to replace "com_testing_subcaption ="05-07 - 06-07" " with the current date. from PHP i can't pass any variable to this.


I would appriciate any suggestions that would help to get it work.

Thanks in advance :)
Jun 15 '07 #1
1 12403
Atli
5,058 Expert 4TB
If you are using PHP to generate this, you can use PHP code to create and insert the date into the XML output.
For example:
Expand|Select|Wrap|Line Numbers
  1. $myXML = "<xmlNode>!-CurrentDate-!</xmlNode>";
  2. $myXML = str_replace("!-CurrentDate-!", date('Y-m-d', time()), $myXML);
  3. echo $myXML;
  4.  
This would output:
<xmlNode>2007-06-18</xmlNode>
Jun 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John Norvell | last post by:
I just noticed that recently the javascript I was using to format and display the last modified date of my web page is always reporting the current date instead. It used to work fine. This is true...
14
by: deko | last post by:
This runs, but does not narrow to current week. suggestions appreciated! SELECT lngEid, dtmApptDate, Subject, Appt_ID FROM qry002 WHERE (dtmApptDate BETWEEN DateAdd("d",-weekday()+2,) And...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
6
by: vijayk | last post by:
Hi all, I have a field which has data as YYYYMMDD, and I have to find the age of the person by substracting it from current date. can you please please advice... thanks
0
by: Shawger Lager | last post by:
Hi, I am new to DB2 (and SQL) and I am having some problems with the current date. I am trying to make sure the date in the table review is not past the current day using a constriant. I have tried...
3
by: seanw89 | last post by:
I have a bit trouble in converting CURRENT DATE into a integer type as YYYYMMDD. The following script is trying to find a day matching a date column with integer type with yesterday (CURRENT DATE...
0
by: remya1000 | last post by:
I need to display current month,last 3months,6months and 1year records seperatly. and first i'm tring to display current month's records. and the error i received is this. Microsoft VBScript...
5
by: bruce24444 | last post by:
I have a database which assigns warranty claims to people with a main screen showing number of files assigned to each person. The number assigned shows day, week, month and year numbers so they can...
2
by: NitinSawant | last post by:
Hello Experts, I'm newbie to php, I want to get date 30 day back from current date using php. i'm able to get current date, $currentDate= date("d-M-y",time());
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.