代码之家  ›  专栏  ›  技术社区  ›  John Polling

用C语言进行有效的自定义标签解析#

  •  1
  • John Polling  · 技术社区  · 16 年前

    我想做的是允许开发人员编写自己的自定义标签,例如。

    <cms:news>
        <h1><cms:news:title /></h1>
        <p><cms:news:date /></p>
        <cms:news:story />
    </cms:news>
    

    public void news()
    {
         // Get all of the news articles from the database
    }
    

    public string newstitle()
    {
        // Return the news title for the current news element we are rendering
    }
    

    2 回复  |  直到 16 年前
        1
  •  1
  •   John Polling    16 年前

    我想我一直都看错了。

        2
  •  0
  •   Thomas Levesque    16 年前

    <cms:news>
        <h1><cms:news.title /></h1>
        <p><cms:news.date /></p>
        <cms:news.story />
    </cms:news>