Mfano: XSLT kujenga HTML href ya

Nimekuwa kufanya kidogo ya mambo XSL hivi karibuni na mawazo ningependa kuweka pamoja sampuli kwa ajili ya kumbukumbu yangu ya baadaye na kwamba inaweza kuwa na thamani ya sisi wote XSLT-ER kufanya hai katika internets.

Fikiria XML zifuatazo:

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

zifuatazo XSL snippet kuzalisha orodha Iliyopangwa ya tabo hrefs:

<xsl:template match="FdcSearchTabsCollection" xml:space="preserve">
   
    <!– The "all" tab –>
    <a href="javascript:ViewTab(‘All’)">View all</a>
   
    <!– Kila mtu binafsi tab –>
    <!– Iterate kupitia Tabo zote na kuonyesha sahihi  viungo. –>
    <xsl:for-each select="SearchTab">
      <xsl:sort select="@SortOrder"/>

      …
      <a href="javascript:ViewTab('{@TabID}')"><xsl:value-of select="@Label"/></a>
    </xsl:kwa-kila>

    <br /> 
   

   </xsl:template>

Hapa ni nini inaonekana kama katika SharePoint:

SNAGHTML78aa2cb

 

 

</mwisho>

Kujiunga na blog yangu.

Kufuata yangu juu ya Twitter kwa http://www.twitter.com/pagalvin

Wazo moja juu ya "Mfano: XSLT kujenga HTML href ya

  1. Marc D Anderson

    Hey, Paulo. 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.

    Kujibu

Kuondoka Reply

Anwani yako si kuchapishwa. Mashamba required ni alama *