"Yeager, Victor R." wrote:
> I have an XML file with values that I want to use to initialize some code,
> but one of the fields needs to have the current date/time. Is there any way
> to set up the XML so, when parsed, the value of the appriopriate XML element
> will contain the current date/time?
No. This is the job of the application. Parsers don't know anything
about the tags they parse -- they just pass them to the application. (Of
course, you could write a specialized parser that does this, but that
would be *way* to much work.)
If you don't have control of the application (for example, it's a
browser), you could probably figure out a way to do this with XSLT (some
XSLT processors allow you to plug in your own extensions). If you do
have control of the application (for example, it's an order entry
program), you can add this to your program.
One important thing to remember here is that XML tags are just text.
They don't carry semantics with them the way HTML tags appear to. Any
behaviour in the tags is in the application. (HTML is actually the same
-- tags are also just text. However, browsers (the application) know
what to do with them. For example, when they see <a href="http://foo">
they create a jump to http://foo.)