Eżempju: XSLT Ħolqien HTML Href tal

Stajt kont qed tagħmel daqsxejn ta 'għalf XSL aħħar u ħsibt I d tpoġġi flimkien kampjun għal referenza futura tiegħi u li jistgħu jkunu ta' valur għalina lkoll XSLT-hom teħid ta 'għajxien fil-internets.

Ikkunsidra l-XML ġej:

<FdcSearchTabsCollection Count="2">
  <SearchTab Label="Industry" SortOrder=”00” Label=”Industries” SearchConstraints="contenttype:Industrija" TabID="831b2a74-98c4-4453-8061-86e2fdb22c63"/>
  <SearchTab Label="Practices" SortOrder=”01” Label=”Practices” SearchConstraints="contenttype:PracticeGroups" TabID="678e206b-6996-421f-9765-b0558fe1a9c0"/>
</FdcSearchTabsCollection>

Il snippet XSL ġej ser jiġġenera lista magħżula ta 'tabs hrefs:

<XSL:template match="FdcSearchTabsCollection" xml:space="preserve">
   
    <!– The "all" tab –>
    <a href="javascript:ViewTab(‘All’)">Ara kollox</a>
   
    <!– Kull tab individwali –>
    <!– Jtenni permezz kollha Tabs u juru l-korretta  rabtiet. –>
    <XSL:for-each select="SearchTab">
      <XSL:sort select="@SortOrder"/>

      …
      <a href="javascript:ViewTab("{@TabID}")"><XSL:value-of select="@Label"/></a>
    </XSL:għal-kull>

    <br /> 
   

   </XSL:template>

Hawn dak li jidher qisu fil SharePoint:

SNAGHTML78aa2cb

 

 

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Wieħed ħasbu dwar "Eżempju: XSLT Ħolqien HTML Href tal

  1. Marc D Anderson

    Hey, Paul. Interesting that the XML isn’t valid, as each SearchTab element has two Label attributes. Please tell me that SharePoint doesn’t generate that!

    M.

Ħalli Irrispondi

Your email address mhux se jkun ippubblikat. Meħtieġa oqsma huma mmarkati *