Create node set and pass as a parameter

后端 未结 2 674
清歌不尽
清歌不尽 2020-12-01 10:51

Using XSLT 1.0, I\'m trying to essentially create a small node set and then pass it as a parameter to a template, something like the following:



        
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 11:14

    Well, I managed to get around this in the following way:

    First add a custom namespace to your stylesheet, e.g. xmlns:myns="http://my.ns.com"

    Then define the nodeset at the top of the stylesheet:

    
        widget.recent-posts.trim-length=100
        widget.recent-posts.how-many=3
        widget.recent-posts.show-excerpt
    
    

    Then reference in the following way:

    
        
    
    

    This works, but it would still be ideal for me to define the node-set within the tag itself, as in the first example I gave.. anyone think that would be possible?

提交回复
热议问题