Check type of node in XSL template

后端 未结 3 1833
忘掉有多难
忘掉有多难 2020-12-10 15:35

Is it possible to check the type of a node I matched with a template inside the same template? In case it is, how can I do it? For example I would like to do something like

3条回答
  •  臣服心动
    2020-12-10 16:02

    Take a look at this answer here, as this should give you the information you need:

    Difference between: child::node() and child::*

    This gives the following xsl:choose to test all the nodes, including the document node.

    
      
        Root
      
      
        Element 
        
      
      
        Text
      
      
        Comment
      
      
        PI
      
      
        Attribute
      
    
    

提交回复
热议问题