How to go about debugging in Media Foundation - ms-media-foundation

The question
Which tools or code constructs (like defines) are the ones that should be used in this area and how to get them to work? Is there something I as a new person to media foundation should do before asking my question here to avoid simple mistakes?
The question is not "what is your favorite tool, lets fight over who is right" but simply, in regards to this media foundation framework, which options are according your expertise in the area worth considering for debugging and how do I use them?
Background to why I am asking this
Looking around on stackoverflow it seems that some questions are asked without knowledge of how to properly debug Media Foundation applications. I some cases a specific question gets an answer that states that OP should use MFTrace 1, 2. I also belive that my earlier questions here would have been helped out by using proper debugging tools or traces specific to media foundation.
Things I as someone new to this framework have encountered
I myself have not even been able to get MFTrace or Event Viewer to work, both tools that are mentioned in the official media foundation blog.
The documentation for how to get the MFTrace is lacking, is it only available in the old win 7 SDK on .NET 4.0 which is referred to here? Or can one use a newer SDK? Installing the older win 7 SDK involves some pain points on windows 10 (first change regedit values, how to do that, new error -> SO suggest to look at the log and maybe uninstall any existing Visual C++ 2010 redistrubutable.)
It would be nice to know if this is something you have to go through, in which case I will, or if MFTrace can be found elsewhere.
I did not get any logs from the Event Viewer. But maybe one should skip that tool altogether and only use MFTrace since the official blog says the following?
However, MFTrace is much more powerful, and collects way more information, than Event viewer. source
Besides tools, is there no?
#define MF_TRACE_LEVEL 15
In this ms blog post they mention EventWriteString and a few TRACE_LEVEL defines. Is this something that is useful outside MFTrace?

Usually I use the following:
VS Debugger, with debug logging via OutputDebugString for most work. It works quite well, even with the asynchronous nature of media foundation.
MFTrace for detailed analysis in hard to analyze cases. This often involves looking up obscure GUIDS in MFAPI.h
Occasionally TOPOEDIT is helpful in testing things out. It's not nearly as capable as GraphEdit though.
Running the Microsoft Media Foundation SDK Samples, or have a look at MFNode. The samples from the Developing Microsoft Media Foundation book are also downloadable from the web. Be aware that some SDK samples have been obsoleted, if you need to look at those you may need to download older SDKs until you find them. There are more samples floating around. Find them.
Look on Stack Overflow, or on the MSDN Media Foundation Forum. Pay close attention to any answers from Roman Ryltsov ;)
If you are new to COM development, be sure to read The N habits of Highly Defective DirectShow Applications. Although it's direct Show specific, a lot of it still applies. In particular: Use and understand CCOMPtr and when you need to use mutexes.
Running MFTRACE:
MFTrace is not pretty, but it does not end up being hard after it gets figured out. The MS Blog entries referenced at the end helped a lot, as does the Text Analysis Tool.
Start an ADMIN command prompt.
run MFTRACEPATH.bat to add the MFTRACE.EXE location to the path
cd {YourExecutableLoc}
run MFTRACECALLER.BAT {YOUREXECUTABLENAME} (Without any Extension)
load YOUREXECTUABLENAME.TXT into the Text Analysis tool to help filter the output.
Occasionally MFTRACEParseTopologies.bat, mentioned in the MSDN blogs is useful.
I use these .bat scripts to run MFTRACE (Remember: Use ADMIN command prompt!)
MFTRACEPATH.BAT:
#echo off
Echo MFTracePath.bat adds MFTrace to path
SET _NT_SYMBOL_PATH=C:\Users\sschi\AppData\Local\Temp\SymbolCache;%QTDIR%\bin
SET PATH=%PATH%;%PROGRAMFILES(x86)%\Windows Kits\10\bin\x86
cd {your Binary Folder}
echo run MFTraceCaller CapstoneDebug next
MFTRACECALLER.BAT
#echo off
SET exFile=MYEXECUTABLEFILENAME
if '%%1' == '' goto start
set exFile=%1
:START
echo Starting MFTRACE using %exFile%, saving output to %exFile%.txt
#echo on
mftrace -es -k all -l 4 -o %exFile%.txt %exFile%.exe %2 %3 %4 %5
#echo off
echo.
echo Trace completed - output is in %exFile.Txt%
echo.
echo Post Processing is available using
echo MFTraceParseTimeStamps.bat
echo MFTraceParseTopologies.bat
echo a) Open %exfile%.txt in TextAnalysisTool
echo b) Load TextAnalysisToolDebugFilters.tat
The text analysis tool helps a lot to filter the mountain of output. Use "File", "Load Filters" to load the filters as needed You can turn individual filters on and off to help zero in on what you are doing. Also, higher filters override lower ones, so for example, the text "Error" in a line overrides everything below it. Also, turn on any "OutputDebugString" logging in your file, it will appear in the traced output.
Below is my 'kitchen sink' filters file. Turn off everything but the red error traces to start.
FILTERS.TAT:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<TextAnalysisTool.NET version="2016-06-16" showOnlyFilteredLines="False">
<filters>
<filter enabled="y" excluding="n" description="" foreColor="ff0000" type="matches_text" case_sensitive="n" regex="n" text="Error" />
<filter enabled="y" excluding="n" description="" foreColor="000000" backColor="ffa500" type="matches_text" case_sensitive="n" regex="n" text="Warning" />
<filter enabled="n" excluding="n" description="" backColor="ffa500" type="matches_text" case_sensitive="n" regex="n" text="Process Frame" />
<filter enabled="y" excluding="n" description="" backColor="90ee90" type="matches_text" case_sensitive="n" regex="n" text="MESessionStart" />
<filter enabled="y" excluding="n" description="" backColor="90ee90" type="matches_text" case_sensitive="n" regex="n" text="MESessionStopped" />
<filter enabled="y" excluding="n" description="" backColor="90ee90" type="matches_text" case_sensitive="n" regex="n" text="MESessionPaused" />
<filter enabled="y" excluding="n" description="" backColor="90ee90" type="matches_text" case_sensitive="n" regex="n" text="UpdatePendingCommands" />
<filter enabled="y" excluding="n" description="" backColor="90ee90" type="matches_text" case_sensitive="n" regex="n" text="SetPositionInternal" />
<filter enabled="n" excluding="n" description="" foreColor="008000" backColor="add8e6" type="matches_text" case_sensitive="n" regex="n" text="Scrub" />
<filter enabled="y" excluding="n" description="" foreColor="008000" backColor="d3d3d3" type="matches_text" case_sensitive="n" regex="n" text="<<<<<< " />
<filter enabled="y" excluding="n" description="" foreColor="008080" backColor="f0e68c" type="matches_text" case_sensitive="n" regex="n" text="RequestSample" />
<filter enabled="y" excluding="n" description="" foreColor="006400" type="matches_text" case_sensitive="n" regex="n" text="MESession" />
<filter enabled="y" excluding="n" description="" foreColor="008000" type="matches_text" case_sensitive="n" regex="n" text="MFStartup" />
<filter enabled="y" excluding="n" description="" foreColor="008000" type="matches_text" case_sensitive="n" regex="n" text="MFShutdown" />
<filter enabled="y" excluding="n" description="" foreColor="800080" type="matches_text" case_sensitive="n" regex="n" text="Grabber" />
<filter enabled="y" excluding="n" description="" foreColor="800080" type="matches_text" case_sensitive="n" regex="n" text="Seek" />
<filter enabled="y" excluding="n" description="" foreColor="d2691e" type="matches_text" case_sensitive="n" regex="n" text="GraphBuilder" />
<filter enabled="y" excluding="n" description="" foreColor="2e8b57" type="matches_text" case_sensitive="n" regex="n" text="MF_TOPOLOGY" />
<filter enabled="y" excluding="n" description="" foreColor="2e8b57" type="matches_text" case_sensitive="n" regex="n" text="MF_TOPONODE" />
<filter enabled="y" excluding="n" description="" foreColor="2e8b57" type="matches_text" case_sensitive="n" regex="n" text="MF_TRANSFORM" />
<filter enabled="y" excluding="n" description="" foreColor="5f9ea0" type="matches_text" case_sensitive="n" regex="n" text="CurrentPosition" />
<filter enabled="y" excluding="n" description="" foreColor="5f9ea0" type="matches_text" case_sensitive="n" regex="n" text="CMFMediaSession" />
<filter enabled="y" excluding="n" description="" foreColor="0000ff" type="matches_text" case_sensitive="n" regex="n" text="OutputDebugString" />
<filter enabled="n" excluding="n" description="" foreColor="b22222" type="matches_text" case_sensitive="n" regex="n" text="MF_SOURCE_READER" />
<filter enabled="n" excluding="n" description="" foreColor="008080" type="matches_text" case_sensitive="n" regex="n" text="CoCreateInstance" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="MeStream" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="MESource" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="MFT_MESSAGE" />
<filter enabled="y" excluding="n" description="" foreColor="008080" type="matches_text" case_sensitive="n" regex="n" text="MF_MT_SUBTYPE" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="Sample" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="ProcessInput" />
<filter enabled="y" excluding="n" description="" foreColor="008b8b" type="matches_text" case_sensitive="n" regex="n" text="ProcessOutput" />
<filter enabled="y" excluding="n" description="" foreColor="008000" type="matches_text" case_sensitive="n" regex="n" text="OnClock" />
<filter enabled="y" excluding="n" description="" foreColor="b22222" type="matches_text" case_sensitive="n" regex="n" text="Met=" />
</filters>
</TextAnalysisTool.NET>
Additional References
Introduction to Text Analysis Tool
textanalysistool.github.io
Microsoft Media Foundation Blog Entries

Related

status="NotProcessed" for EnhancedAirBookRQ API

Can anyone help me in this regard, checking with Sabre Soap API's for booking flow. I am getting the failure in EnhancedAirBookRQ response.
I am getting the below response :
<ApplicationResults status="NotProcessed" xmlns="http://services.sabre.com/STL_Payload/v02_01">
<Error type="BusinessLogic" timeStamp="2018-10-01T05:38:45.063-05:00">
<SystemSpecificResults>
<Message code="ERR.SWS.HOST.ERROR_IN_RESPONSE">*NO FARES/RBD/CARRIER</Message>
<Message code="146">*NO FARES/RBD/CARRIER</Message>
</SystemSpecificResults>
</Error>
</ApplicationResults>
Request:
<v3:EnhancedAirBookRQ version="3.2.0" HaltOnError="true" IgnoreOnError="true">
<v3:OTA_AirBookRQ>
<v3:OriginDestinationInformation>
<v3:FlightSegment ArrivalDateTime="2018-11-11T07:38:00" DepartureDateTime="2018-11-11T06:31:00" FlightNumber="6384" NumberInParty="1" ResBookDesigCode="K" Status="NN">
<v3:DestinationLocation LocationCode="BOS" />
<v3:Equipment AirEquipType="E90" />
<v3:MarketingAirline Code="TP" FlightNumber="6384" />
<v3:MarriageGrp Ind="false" />
<v3:OperatingAirline Code="B6" />
<v3:OriginLocation LocationCode="JFK" />
</v3:FlightSegment>
<v3:FlightSegment ArrivalDateTime="2018-11-12T06:00:00" DepartureDateTime="2018-11-11T18:40:00" FlightNumber="218" NumberInParty="1" ResBookDesigCode="K" Status="NN">
<v3:DestinationLocation LocationCode="LIS" />
<v3:Equipment AirEquipType="332" />
<v3:MarketingAirline Code="TP" FlightNumber="218" />
<v3:MarriageGrp Ind="true" />
<v3:OperatingAirline Code="TP" />
<v3:OriginLocation LocationCode="BOS" />
</v3:FlightSegment>
<v3:FlightSegment ArrivalDateTime="2018-11-12T12:20:00" DepartureDateTime="2018-11-12T08:40:00" FlightNumber="6791" NumberInParty="1" ResBookDesigCode="K" Status="NN">
<v3:DestinationLocation LocationCode="LUX" />
<v3:Equipment AirEquipType="73H" />
<v3:MarketingAirline Code="TP" FlightNumber="6791" />
<v3:MarriageGrp Ind="true" />
<v3:OperatingAirline Code="LG" />
<v3:OriginLocation LocationCode="LIS" />
</v3:FlightSegment>
<v3:FlightSegment ArrivalDateTime="2018-11-15T12:25:00" DepartureDateTime="2018-11-15T10:55:00" FlightNumber="3761" NumberInParty="1" ResBookDesigCode="X" Status="NN">
<v3:DestinationLocation LocationCode="OPO" />
<v3:Equipment AirEquipType="73W" />
<v3:MarketingAirline Code="LG" FlightNumber="3761" />
<v3:MarriageGrp Ind="false" />
<v3:OperatingAirline Code="LG" />
<v3:OriginLocation LocationCode="LUX" />
</v3:FlightSegment>
<v3:FlightSegment ArrivalDateTime="2018-11-15T15:30:00" DepartureDateTime="2018-11-15T14:30:00" FlightNumber="1947" NumberInParty="1" ResBookDesigCode="W" Status="NN">
<v3:DestinationLocation LocationCode="LIS" />
<v3:Equipment AirEquipType="AT7" />
<v3:MarketingAirline Code="TP" FlightNumber="1947" />
<v3:MarriageGrp Ind="false" />
<v3:OperatingAirline Code="WI" />
<v3:OriginLocation LocationCode="OPO" />
</v3:FlightSegment>
<v3:FlightSegment ArrivalDateTime="2018-11-15T20:00:00" DepartureDateTime="2018-11-15T17:00:00" FlightNumber="209" NumberInParty="1" ResBookDesigCode="W" Status="NN">
<v3:DestinationLocation LocationCode="JFK" />
<v3:Equipment AirEquipType="332" />
<v3:MarketingAirline Code="TP" FlightNumber="209" />
<v3:MarriageGrp Ind="true" />
<v3:OperatingAirline Code="TP" />
<v3:OriginLocation LocationCode="LIS" />
</v3:FlightSegment>
</v3:OriginDestinationInformation>
</v3:OTA_AirBookRQ>
<v3:OTA_AirPriceRQ>
<!--v3:PriceComparison /-->
<v3:PriceRequestInformation Retain="true">
<v3:OptionalQualifiers>
<v3:PricingQualifiers>
<v3:PassengerType Code="ADT" Quantity="1" />
</v3:PricingQualifiers>
</v3:OptionalQualifiers>
</v3:PriceRequestInformation>
</v3:OTA_AirPriceRQ>
<v3:PostProcessing IgnoreAfter="false" />
<v3:PreProcessing IgnoreBefore="false" />
</v3:EnhancedAirBookRQ>
Checking this test step in soap ui project given by Sabre on their developer portal. Before this, checked for test-steps for create session and low fare search for flights.
Can anyone tell any way to resolve on this. Thanks for any help.
EnhancedAirBookRQ flight details are not correct. Please verify or use search API again to fetch correct details

Drupal 8 - Solr 6.6.x Does not split fulltext field type values into mutliple words in spell

I'm trying to setup a Solr 6.6.x schema.xml to work with a Drupal 8 (using Search API Solr), the main problem is indexed values are not split into multiple words (like : "Web developer" must be split in "Web" and "Developer" in spell) but it's not working, see below my schema.xml, any tips ?
Screenshot of indexed examples in Solr UI
Note: All my fields using this config :
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<!-- Case insensitive stop word removal. -->
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
/>
<!--<filter class="solr.WordDelimiterGraphFilterFactory" />-->
<filter class="solr.WordDelimiterGraphFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
splitOnCaseChange="1"
preserveOriginal="1"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="100"/>
</fieldType>
https://gist.github.com/anonymous/af00ed3052fc6e85140ed5ec9842e4bf

Can't remove punctuation in Solr

I have a solr install to query content on a Drupal site. Many of the title fields have punctuation at the start of the string and so when I sort by title the punctuation appears top of the list.
I would like to get solr to ignore the the title when sorting by title but none of the solutions I have tried work.
I am fairly new to solr and so it may be something really simple that I am doing wrong... I don't really understand much of what is going on in the schema.xml file!
The title field is called label in solr and I have tried various methods in solr.PatternReplaceFilterFactory which do not work.
<field name="label" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
<copyField source="label" dest="sort_label"/>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory"
pattern="(^\p{Punct}+)" replacement="" replace="all"
/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="0"
splitOnCaseChange="0"
preserveOriginal="1"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
…
</analyzer>
My query is
start=0&rows=25&q=education&fl=id%2Centity_id%2Centity_type%2Cbundle%2Cbundle_name%2Csort_label%2Css_language%2Cis_comment_count%2Cds_created%2Cds_changed%2Cscore%2Cpath%2Curl%2Cis_uid%2Ctos_name%2Czm_parent_entity%2Css_filemime%2Css_file_entity_title%2Css_file_entity_url&pf=content%5E2.0&&sort=sort_label%20asc
This is done with the WordDelimiterFilterFactory. Set generateWordParts=1. Add this filter to your
After modifying the schema.xml restart the server and re-index the data.
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="0"
splitOnCaseChange="0"
preserveOriginal="1"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>

How to transform sitemap XML file into breadcrumb using XSLT in SDL Tridion?

I have a XML file for sitemap, here it is:
<?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>
What i've did till now:
create a function in script tag in PT DWT TBB. where,
pageload()
{ id="##Page.ID##" }
this TBB inherits a (.cs file) where i defined a id property in a class. create a object of this class type and access the property. used this property as XSLT argument and apply the transformation through xsl.
Any other suggestion'd be good.
Manoj, The below XSL might help.. I have not tested this, but used it in some past projects the xml structure is slightly different but the below snippet should help you on moving forward in the right direction.
<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..
<xsl:value-of select="#title"/> > --> breadcrumb separator ">"
</xsl:for-each>
<xsl:value-of select="#title"/>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Have you considered this?: http://msdn.microsoft.com/en-us/library/x20z8c51.aspx

Menu link security trimming

I am having a problem with security trimming of menu links provided by the sitemap. If I set securityTrimmingEnabled="false", my menu works but there's no security trimming. If I set securityTrimmingEnabled="true", my menu just disappears. How can I fix this?
In web.config, I have:
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true" >
<providers>
<clear />
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
In Site.master, I have:
<div class="clear hideSkiplink">
<asp:Menu ID="Menu1" runat="server" CssClass="menu" DataSourceID="SiteMapDataSource1">
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</div>
In Web.sitemap, I have:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="***">
<siteMapNode url="" title="***">
<siteMapNode url="~/***.aspx" title="***" />
<siteMapNode url="~/***.aspx" title="***" />
<siteMapNode url="~/***.aspx" title="***" />
<siteMapNode url="~/***.aspx" title="***" />
</siteMapNode>
<siteMapNode url="" title="***">
<siteMapNode url="~/Account/***.aspx" title="***" />
<siteMapNode url="~/Account/***.aspx" title="***" />
<siteMapNode url="~/Account/***.aspx" title="***" />
<siteMapNode url="~/Account/***.aspx" title="***" />
</siteMapNode>
</siteMapNode>
</siteMap>
You need to specify roles on your nodes like this (as per this article http://msdn.microsoft.com/en-us/library/ms178428.aspx)
<siteMapNode title="Support" description="Support" url="~/Customers/Support.aspx" roles="Customers" />
All nodes are by default not displayed when securityTrimmingEnabled is enabled unless you are in one of the allowed roles. To allow all roles you can do this roles="*" (as described here http://blogs.msdn.com/b/dannychen/archive/2006/03/16/553005.aspx)

Resources