How to copy external CSS and JavaScript in XSLT

前端 未结 3 1714
死守一世寂寞
死守一世寂寞 2021-02-02 18:25

I have an XSL transformation which outputs HTML. In the head element I have a CSS file reference.



        
3条回答
  •  北海茫月
    2021-02-02 19:05

    XSLT 2.0 provides the unparsed-text() function to read documents via URL that are not XML.

    In XSLT 1.0, if you don't need to be too script about the CSS, you can use the following to make the CSS file XML-compatible. And, fortunately, the browsers tolerate the HTML comments.

    CSS

     
    body
    {
        margin: 0;
    }
    div > p
    {
        background-color: yellow;
    }
    ]]> 
    

    XSLT

    
    

提交回复
热议问题