ASP 高级模板引擎实现类(6)


                If Len(datasource) > 0 Then Attribute = Replace(Attribute, "datasource=""" & datasource & """", "")
                If page > 0 Then Attribute = Replace(Attribute, "page=""" & page & """", "")
                Attribute = Replace(Attribute, "name=""" & Name & """", "", 1, -1, 1)
                Attribute = Replace(Attribute, "element=""" & Element & """", "", 1, -1, 1)
                Process = Array(Attribute, Text, Element)
            Else
                Process = Array(Attribute, "", "div")
            End If
        Else
            Process = Array(Attribute, "", "div")
        End If
        Set Matches = Nothing
    End Function

    ' ***************************************
    '    解析
    ' ***************************************
    Private Function Analysis(ByVal id, ByVal Name, ByVal Content, ByVal page, ByVal PageID)
        Dim Data
        Select Case Lcase(Name)                                                    ' 选择数据源
            Case "loop" Data = DataBind(id, Content, page, PageID)
            Case "for" Data = DataFor(id, Content, page, PageID)
        End Select
        Analysis = Data
    End Function

    ' ***************************************
    '    绑定数据源
    ' ***************************************
    Private Function DataBind(ByVal id, ByVal Content, ByVal page, ByVal PageID)
        Dim Text, Matches, SubMatches, SubText

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2094.html