![]() |
![]() ![]() ![]() |
||
|
|||
Example: user login |
If you're running a site that has userlogins on the main page -- as an example, see most newspapers' homepages -- and you want this to propagate through the user's time in your homepages, then this is easily done with XML Script. |
||
Solutions |
Firstly, all of your webpages should be well-formed XML, so that the Xerces parsing engine that X-Tract runs can deal with them. If they're not, then they can still be echoed straight to the output without parsing, but the solution then becomes non-trivial. A simple solution, therefore, is to include interpolations in a set of webpages: each <a> anchor tag should be reformatted as below. where site.xst is the name of the script being run, and next.html is the file that the anchor is meant to be linking to. The %2E is required because the file name needs to be CGI-encoded: full stops are turned into their ASCII representation, which, in hexadecimal, is 2E. See later for an alternative solution.
|
||
When the HTML file is read into X-Tract using the _eval command, the interpolations are all completed. \.cgi_string should contain all the information needed to keep track of who is logged into the website; schematically, we have:
|
|||
This is all accomplished thus, where the user objects
come from a password file, all in XML, and just containing items of
|
|||
The above program replaces every interpolation in the file requested
with |
|||
Tip |
Rather than changing all of the .html to
|
||
Development |
Obviously, the above script is just a solution to one small problem. But we hope it suggests lots of implementations of XML Script in this area. So if you're stuck, or you have some ideas you'd like us to implement for you, or you have some ideas for new examples to go in this section, by all means e-mail us on support@xmlscript.org and one of our engineers will get back to you. |
||
Next... | |||
XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited© Copyright 1998-2000 DecisionSoft Limited |