use xsl to output plain text

前端 未结 2 1910
灰色年华
灰色年华 2020-12-13 14:09

I needed to use XSL to generate simple plain text output from XML. Since I didn\'t find any good, concise example online, I decided to post my solution here. Any links refer

2条回答
  •  情话喂你
    2020-12-13 14:48

    Just for fun: this can be done in a very general and compact way:

    
        
        
        
    
        
            
             
        
    
        
           at -f 
        
    
    

    when applied on this XML document:

    
    

    the wanted, correct result is produced:

       at -f 09:33 05/05/2011 
       at -f 09:33 05/05/2011 
       at -f 09:33 05/05/2011  
    

    Note: This genaral approach is best applicable if all the data to be output is contained in text nodes -- not in attributes.

提交回复
热议问题