2017-09-26 53 views
0

我的項目有很多xml文件用於構建html頁面&頁面操作。這是網格模板的示例。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

它用於單頁面應用程序中,使用從瀏覽器到服務器中的XML文件/ JSON文件的ajax調用來填充頁面,從而避免重新加載整個頁面。 。看看這個例子 https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_xml2

這裏上單擊表格被加載XML數據從cd_catalog.xml按鈕

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

其architechture是在方式類似於HTML,無論是標記語言。 使用標籤的嵌套結構訪問數據。在cd.catalog示例中,標題列以catalog-> cd-> title的形式訪問。

+0

謝謝Nivetha,但我想你說的是完全不同的概念,但你並沒有完全錯誤。在我的情況下,XML是設計HTML。 E.g. 這是使用Delete click事件的圖像按鈕呈現。 –