`server parsed' XML?

rev-bob at gotc.com rev-bob at gotc.com
Tue Nov 9 11:30:29 GMT 1999


> > What I want is to have a static xml file lying around, that has some sort
> > of token in it that represents, say, the current date.  In my program, as I
> > parse the xml file, I want to dynamically change that token into a string
> > representing the date.
> > 
> > That is, say I have a file foo.xml that contains in it:
> > 
> >    blah, blah, blah &date; blah, blah, blah
> > 
> > When I read it in on November 15, 1999, I want to get back
> > 
> >    blah, blah, blah November 15, 1999 blah, blah, blah
> 
> This is more or less how "interpolations" work in XML Script
> (www.xmlscript.org), although in this case you'd write:
> 
> blah, blah, blah #time()# blah, blah, blah
> 
> Then when this is processed by an XML Script processor everything between
> the hashes (in this case, the time() built-in command) is evaluated.

Here's another option, depending on what you have available to you.  I've had wonderful 
success using Inline's iHTML software (see their site at http://www.ihtml.com) to make 
a given document morph on the fly - and contrary to the name's implications, this will 
work just fine on XML documents if you configure it to do so.  (For instance, see 
http://www.gotc.com/index.xml - when you look at the source, you should see a few 
examples of dynamic processing at work.  Among the most obvious are that the slogan 
under the logo, the background image, the fake ad at the bottom of the page, and the 
warning/note just above the navigation bar are all set randomly from a list of options in a 
database - no client-side scripting required.  There's also a JavaScript routine that looks 
fairly pointless - fancy() is set up to simply return one number, with no indication of how 
that number was calculated.  Naturally, it was done on the server.)

I should note a few things at this point.  First, that GOTC page is still a work-in-progress, 
and if anyone has trouble seeing it with a functional XML browser, I'd like to know 
about it before I make that part of the site live.  Second, iHTML can be fairly expensive 
for an individual user, but once you get to a company level, that's not so bad.  (I'm lucky 
enough to use an ISP that has the Enterprise edition installed.)  Finally, iHTML code 
does not look well-formed; while this is not a functional problem, odds are it'll give a 
validation tool fits if you run the tool on the raw code instead of on what you get if you 
actually have iHTML parse the code first.



 Rev. Robert L. Hood  | http://rev-bob.gotc.com/
  Get Off The Cross!  | http://www.gotc.com/

Download NeoPlanet at http://www.neoplanet.com


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list