xsl:template match doesn't find matches

后端 未结 3 806
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 08:05

I\'m trying to convert some Xaml to HTML using the .NET XslCompiledTransform and am running into difficulties getting the xslt to match Xaml tags. For instance with this Xaml i

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-20 08:35

    Yes, it's a problem with the namespace. All of the elements in your input document are in the namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation. Your template is trying to match elements that are in the default namespace, and it's not finding any.

    You need to declare this namespace in your transform, assign it a prefix, and then use that prefix in any patterns that are intended to match elements in that namespace. So your XSLT should look something like this:

    
    
    
    
    
    
      
        
          
        
      
    
    
    
      
    
    
    
      

提交回复
热议问题