xml中的HTML模板 - 这是什么类型的架构?

时间:2017-09-26 12:37:42

标签: html asp.net xml architecture

我的项目有许多xml文件用于构建html页面&页面操作。以下是网格模板的示例。

<Contact singular="Contact" indeal="" nodeal="ContactsPlaybook" tooltip="Document Playbook" library="true" tabHidden="true">
<ListingScreen handle = "PlaybookContacts.ashx" suppressCount="true" showFilters="true">
  <IncludeScript src="scripts/jjedsEmaUser.js"/>
  <SmartIcon editMode="false" requiredAction="Create" name="new" image="new.png" tooltip="Create" separator="false" href="PlaybookContactDetail.ashx?DealRef=${DealRef}" edit="true" />
  <SmartIcon editMode="false" requiredAction="Delete" name="BulkDelete" image="delete.png" tooltip="Delete" separator="true"/>
  <SmartIcon editMode="false" requiredAction="Read" actionOn="Contact" name="email" image="mail.png" tooltip="Email Team" href="PlaybookEmailTeam.ashx?DealRef=${DealRef}&amp;Subject=Playbook&amp;Body=${LinkToPage}" edit="true" />
  <SmartIcon editMode="false" requiredAction="Read" name="print" image="print.png" tooltip="Print" onclick="javascript:window.print()" />
  <!--<SmartIcon editMode="false" requiredAction="Administrate" name="CreateEmaUser" image="add_EMA_user.png" tooltip="Create EMA user" onclick="return emans.jjedsEmaUser.create('${DealRef}', '#ListingForm')" />-->
  <Filters>
    <Filter label="Functional Team" filter="FunctionalCategoryFilter" field="ContactGroupID" prefix="C" empty="FunctionalCategoryRef_NULL">
      <PossibleValues displayProperty="Name" />
    </Filter>
    <Filter label="Country" filter="CountryFilter" by="name" prefix="AD" field="CountryID" displayProperty="Code" empty="-1">
    </Filter>
    <Filter label="Business Unit" filter="PickListIntFilter" field="BusinessUnit" prefix="C" empty="-1" onlyifsettingtrue="UseSpecialUserDealAccess">
      <PossibleValues category="Deal" subcategory="BusinessUnit" />
    </Filter>
  </Filters>
  <Sorting>
    <SortColumn name="FullName" dir="asc"/>
  </Sorting>
  <Query alias="C" ignoreArchiving="true" ignoreDeal="true">
    <Block by="C.ContactGroupID" resolveto="DepartmentName" as="Department" />
    <JoinTo table="Address" alias="AD" from="C.AddressID" to="AD.AddressID">
    </JoinTo>
    <Constraint left="C.IsArchived" int="0" />
  </Query>
  <Column command="true" title="&lt;input type='checkbox' header='true' onclick='ToggleCheckAll(this);'&gt;" editMode="false" special="IsDelete" macro="Checkbox" onClick="ToggleCheckBox(this);"/>
  <Column command="true" requiredAction="Update" title="" field="Blank" dbColumn="C.ContactID" macro="ImageLink" fieldType="Contact" tooltip="Edit" image="edit.png" edit="true" />
  <Column title="Full Name" field="FullName" macro="LinkToRef" resolveto="FullContactName" from="C.ContactID" contactAlias="C" linkPage="PlaybookContactDetail.ashx"/>
  <Column title="Organization" field="C.Affiliation" macro="Text" />
  <Column title="Business Unit" field="C.BusinessUnit" property="BusinessUnit" macro="PickList" category="Deal" subcategory="BusinessUnit" storeInt="true" onlyifsettingtrue="UseSpecialUserDealAccess"/>
  <Column title="Role" field="C.Role" macro="Text" />
  <Column title="Phone" field="C.Phone" macro="Text" />
  <Column title="Email" field="C.Email" macro="MailToRef" />
  <DeleteDialog name="ContactDelete" info="If you really want to delete {0} please choose the contact which will be used instead."
            title="Confirm delete" type="ContactDeleteDialog" >
  </DeleteDialog>
</ListingScreen>
</Contact>

有人能告诉我这是什么类型的架构,使用这种架构的真正好处是什么?

1 个答案:

答案 0 :(得分:1)

它用于单页面应用程序,使用从浏览器到服务器中的XML文件/ JSON文件的ajax调用来填充页面,从而避免重新加载整个页面。 看看这个例子 https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_xml2

在单击按钮时,表格将从cd_catalog.xml

加载xml数据

https://www.w3schools.com/js/cd_catalog.xml

它的架构类似于HTML,两者都是标记语言。 使用标签的嵌套结构访问数据。在cd.catalog示例中,标题列作为catalog-&gt; cd-&gt; title进行访问。