您的位置:首页 > 其它

利用xml 的数据描述功能设计灵活的专题模板

2004-06-29 20:32 661 查看
借助xml 的数据描述功能设计灵活的专题模板
——由于页面样式的多样性、页面中栏目数目的不固定性,导致用简单的二维数据库表很难描述出一个页面的框架,也就很难满足编辑们所要求的灵活性。然而,如果能够借助xml 的数据描述功能描述出页面的框架,那么前面的问题就可以得到解决,或者说是问题就被转移到了xml document 的维护上了。   用xml 描述页面框架
  本着“横向切分页面”的原则,我们把页面切分成若干个层叠起来的行(一般每个横向的行就是一个table 元素),然后把每行划分成一个或多个纵向的列(列对应的就是table 中的一个td单元格),最后再把每列细分为几个层叠起来的区块,区块被看作是最小的页面模块,他是一组文字、链接以及图片的组合,如新闻列表、图文列表等等。   <subject>
  <head>
    <title></title>
    <author></author>
    <date></date>
    <lastupdate></lastupdate>
    <description></description>
    <keywords></keywords>
    <mets></mets>
    <stylesheet></stylesheet>
  </head>
  <body>
    <![CDATA[
      row    --> 一个横向的行
      column --> 组成row 的纵向的列
      block  --> 最基本的页面模块
   
      ratio  --> 当前行中各个列的宽度比
      file   --> <!@ include file="$file" />
      page   --> <%jsp:include page="$page" flush="true" %>
      id     --> 对应新闻栏目的id
      style  --> 该栏目的显示样式:纯新闻列表、相册、图文混排、显示新闻内容(类似于静态编辑)
    ]]>
    <row ratio=""> <!-- 此处存放导航栏-->
      <column>
        <block file="" page="" id="" style=""></block>
      </column>
    </row>       <row ratio=""> <!-- 此处存放标题图片-->
      <column>
        <block file="" page="" id="" style=""></block>
      </column>
    </row>       <row ratio=""> <!-- 正文的第一行-->
      <column> <!-- 第一列分上下两个区块-->
        <block file="" page="" id="" style=""></block>
        <block file="" page="" id="" style=""></block>
      </column>
      <column> <!-- 第一列分上、中、下三个区块-->
        <block file="" page="" id="" style=""></block>
        <block file="" page="" id="" style=""></block>
        <block file="" page="" id="" style=""></block>
      </column>
      <column> <!-- 第三列只有一个区块-->
        <block file="" page="" id="" style=""></block>
      </column>
    </row>       .... <!-- 仿照正文的第一行安排第二行、第三行...-->  
    <row ratio=""> <!-- 此处存放页尾-->
      <column>
        <block file="" page="" id="" style=""></block>
      </column>
    </row>     </body>
</subject>  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息