newObjects (fromerly known as ZmeY soft) HTMLTemplate
Home Products Docs & Libs
pixel.gif (49 bytes)
Products by category
ALP site
ISAPI filters
Forums (discussions)
Buy direct (RegNet)
Articles and samples
Documentation online

Read more ...
Click here
ALP is implemented as an Asynchronous Pluggable Protocol. It acts like a WEB server but without need of network. It executes WEB applications such as ASP pages and CGI applications. ALP makes Internet Explorer to be server and client. With ALP you can write stand-alone desktop applications, CD-ROM autoruns, use ASP for pure desktop software and still keep your code ready to run on WEB servers too.
Write desktop software in ASP and CGI!
download it

ASP Index

Site navigation
ActiveX components

HTML Parser Light

Parse HTML content to a document tree, change it regenerate it. Wtih this component you can do what the browsers do - understand the page. Can be used for development of HTML template systems, indexing of HTML content and many other tasks.

Highlights of the day
Active Label ActiveX
Barcode ActiveX? Much more - the design and printing inside your WEB application
SQLite3 COM ActiveX embeds the SQLite3 database engine and interface to it. Supports paremeterized views and triggers.
Active Local Pages 1.2
Write desktop apps in ASP and CGI. Create wutorun CDs using WEB technologies - yes it is possible!
ActiveX Pack1 family
Desktop Windows, CE/CE.NET and PocketPC! About 50 powerful components for all the Windows platforms.
AXGate 1.1 (new)
Script dafely any ActiveX in Pocket IE. Build applications in HTML and use local resources and components in them.
IE ScriptBar
Create complex toolbars for Microsoft Internet Explorer easier than you may have expected.

Licensing types legend
(M) Single machine license
(U) Unlimited per-company license
(D) Unlimited development license
(S) Special type of licensing

Quick contact

ASP Help

Active visitors
Suggested links
Suggest this page to the other visitors. Click the button below to place this page in the list above .

Price: FREEWARE Discount for resalers FREEWARE
Information Download Buy
HTMLTemplate - Windows Script Component sample
Download now !

HTMLTemplate - Windows Script Component sample

See also the new age of the HTML templates in ASP. See the ALP Catalog Type 2. A combination of an ActiveX and ASP code provides something better than JSP and ASP.NET can possibly offer.

This sample code realizes simple but useful HTML template functionality. With this component you can create different looking ASP code or applications written using other technique (such us C++) and give them ability to generate HTML pages over a predefined template. Using HTMLTemplate you can fully separate HTML from executable code. This technique gives you ability to create exportable pages, thus implementing critical dynamicaly generated pages as exporters of plain HTML you can create faster sites on slow server. In addition you can implement page generation not in ASP (running on WEB requests) but as scripts for Windows Scripting Host for example. In this case you can schedule page site regeneration for certain hours and so on ...


ZmeY soft provides this code as example of using Windows scripting technologies, You can use it for any purpose without need of additional permissions from us. You can modify code to meet your needs, add features, use code in your own applications (commercial too). Code is provided AS IS without any warranty.

Template syntax

Temlate consist of parts - only one Global area and any number of detail parts.

  • Global part is any text that does not belong to a detail part
  • Detail part is part of the template that begins with <%DETAIL_NAME%> and ends with <%DETAIL_NAME%> tags. DETAIL_NAME can be any alpha-numeric combination. Details can NOT be nested or crosslinked.

Every part can contain any number of replaceable tags. Replaceable tag is name enclosed in "~" symbols - example: ~TAG_NAME~. Tag name can be any alphanumeric combination.

Details can not begin or and at the beginning or end of the template. At least one symbol must exist before first and after last detail tag. For HTML it is not a problem but if you want to change code it is recommended to choose some easy solution like adding spaces on initialization and removing them when getting results. Thish will work faster than algorythm changes that require more complex regular expressions and additional conditions.

How it works ?

HTMLTemplate object have a state property currentPart (see reference below) that specifies currently active part of the template. Replaceable tags are accessible only in the active/current part. Global part always appeares in the output, detail parts will not appear in the output as long as AddNew() is not used to add a copy. Thus setting currentPart to a detail name does nothing - you will need to use method AddNew() to add copy of the detail and then you can replace tags in this copy. You can repeat this action many times - thus any detail can be repeated many times (useful for list of tabular data for example). To understand oblect functionality in details see example code and example page (note that control must be registerd in order to use example page).

Object is implemented using regular expressions.

Copyright newObjects (ZmeY soft) 2001-2005