<% '============================================================= '// '// TemplateManager '// '// version: 0.0.1 '// last modified: 01-Feb-2004 11:00 by Sasha Vukovic '============================================================= %> <% ' Template Requirement: ' - Each element path must be unique ' - Element names can only contain characters [A-Z] [0-9] ' - Each element must finish with "_END" appended to the element name ' ' ' Template Sample: ' ' ' ' ' ' ' ' ' ' ' ' %> <% Class TemplateManager Public mTemplateDoc Public Property Let TemplateDoc( sTemplate ) mTemplateDoc = sTemplate End Property '----------------------------------------------------------------------------------------------------------------- Public Function getElementValue ( ByVal sStyleId ) ' StyleId can also be path. e.g. StyleWinXP/PreTabsCode Dim PosStart, PosEnd, PosCurr, arrElementPath, element ' Remove first slash "/" if present If InStr( sStyleId, "/" ) = 1 Then sStyleId = Right ( sStyleId, Len( sStyleId ) - 1 ) arrElementPath = Split( sStyleId, "/" ) PosCurr = 1 For Each element in arrElementPath PosStart = InStr( InStr( PosCurr, mTemplateDoc, element ), mTemplateDoc, ">" ) + 1 PosCurr = PosStart sStyleId = element Next PosEnd = InStrRev( mTemplateDoc, "