Is there something “like” CSS built into XSL-FO?

后端 未结 2 788
盖世英雄少女心
盖世英雄少女心 2021-02-08 14:30

I know that XSLT itself has attribute-sets, but that forces me to use


every time I want to output an<

2条回答
  •  清歌不尽
    2021-02-08 15:21

    No, you are not required to use xsl:element, the use-attribute-sets attribute can appear on literal result elements if you place it in the XSLT namespace, so you can use something like:

    
    

    If you want to have something close to the CSS functionality then you can add another XSLT transformation at the end of your processing that adds the attributes that you want. You can start with a recursive identity transformation and then add templates matching on the elements you want to change, see a small example below

    
    
      
        value
      
      
        
          
        
      
      
        
          someValue
          
        
      
    
    

提交回复
热议问题