2

サイトマップ用の XML ファイルがあります。これは次のとおりです。

<?xml version="1.0" encoding="utf-8"?>
<siteMap>
  <siteMapNode url="/" title="Home" tcmId="tcm:142-2-4">
    <siteMapNode url="/controls" title="Controls" tcmId="tcm:142-1131-4" type="structure group" />
    <siteMapNode url="/css" title="CSS" tcmId="tcm:142-1134-4" type="structure group" />
    <siteMapNode url="/js" title="JS" tcmId="tcm:142-1133-4" type="structure group" />
    <siteMapNode url="/xslt" title="XSLT" tcmId="tcm:142-1132-4" type="structure group"   />
    <siteMapNode url="/mobile" title="Mobile" tcmId="tcm:142-1165-4" type="structure group" />
    <siteMapNode url="/mobilebiscuitml" title="Mobile BiscuitML" tcmId="tcm:142-1180-4" type="structure group" />
    <siteMapNode url="/system" title="system" tcmId="tcm:142-136-4" type="structure group">
    <siteMapNode url="/system/captcha" title="Captcha" tcmId="tcm:142-260-4" type="structure group" />
    <siteMapNode url="/system/communicator" title="Communicator" tcmId="tcm:142-201-4" type="structure group" />
    <siteMapNode url="/system/errorpages" title="Error Pages" tcmId="tcm:142-322-4" type="structure group" />
    <siteMapNode url="/system/includes" title="includes" tcmId="tcm:142-138-4" type="structure group" />
    <siteMapNode url="/system/masterpages" title="Master Pages" tcmId="tcm:142-139-4" type="structure group" />
    <siteMapNode url="/system/outboundemail" title="Outbound Email" tcmId="tcm:142-199-4" type="structure group" />
    <siteMapNode url="/system/SiteEdit" title="SiteEdit" tcmId="tcm:142-214-4" type="structure group" />
    <siteMapNode url="/system/ui_widgets" title="UI Widgets" tcmId="tcm:142-320-4" type="structure group" />
    <siteMapNode url="/system/webtemplates" title="Web Templates" tcmId="tcm:142-333-4" type="structure group" />
    <siteMapNode url="/system/xml" title="Xml" tcmId="tcm:142-141-4" type="structure group" />
  </siteMapNode>
  <siteMapNode url="/App_GlobalResources" title="Website Labels" tcmId="tcm:142-295-4" type="structure group" />
    <siteMapNode url="/Bpo.aspx" title=" BPO" tcmId="tcm:142-10830-64" type="page" />
    <siteMapNode url="/Careers.aspx" title=" Careers" tcmId="tcm:142-10692-64" type="page" />
    <siteMapNode url="/bpoHitech.aspx" title=" Hitech" tcmId="tcm:142-10710-64" type="page" />
    <siteMapNode url="/news.aspx" title=" News" tcmId="tcm:142-10868-64" type="page" />
    <siteMapNode url="/ISD.html" title="ISD" tcmId="tcm:142-11027-64" type="page" />
    <siteMapNode url="/Services.aspx" title="Services" tcmId="tcm:142-10681-64" type="page" />
    <siteMapNode url="/Knowledge.aspx" title="Knowledge" tcmId="tcm:142-11170-64" type="page" />
  </siteMapNode>
</siteMap>

私が今までやったこと: PT DWT TBB のスクリプト タグに関数を作成します。ここで、pageload() { id="@@Page.ID@@" } この TBB は、クラスで id プロパティを定義した (.cs ファイル) を継承します。このクラス タイプのオブジェクトを作成し、プロパティにアクセスします。このプロパティを XSLT 引数として使用し、xsl を介して変換を適用します。

他の提案は良いでしょう。

4

2 に答える 2

5

Manoj、以下の XSL が役立つかもしれません..私はこれをテストしていませんが、過去のいくつかのプロジェクトでそれを使用しました.xml 構造はわずかに異なりますが、以下のスニペットは正しい方向に進むのに役立つはずです.

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/">
        <xsl:for-each select="//siteMapNode[@title = '<<Controls>>']">  ---> Node title of the current page
            <div id="breadcrumb">
                <xsl:for-each select="ancestor::siteMapNode"> --> selects the parent and loop through.. 
                    <a href="@url"><xsl:value-of select="@title"/></a> &gt; --> breadcrumb separator ">"
                </xsl:for-each>
                <xsl:value-of select="@title"/>
            </div>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
于 2012-06-11T14:31:31.240 に答える
2

これを検討しましたか?: http://msdn.microsoft.com/en-us/library/x20z8c51.aspx

于 2012-06-11T11:10:42.393 に答える