How do I get the current folder path within an XSLT file?

前端 未结 7 1766
萌比男神i
萌比男神i 2020-12-15 20:23

Is there a way to get the current folder path from within a XSLT file?

I need it to locate other XML and XSLT files. We have different customer folders and will need

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 20:59

    Is there a way to get the current folder path from within a xslt file?

    Need it to locate other xml and xslt files

    No need for any extension functions or even parameters to do that!

    Any relative URLs used in the href attribute of an or instruction are resolved based on the URL of the current XSLT stylesheet -- it only needs to have an URL, which is vlearly stated as true in the question above. This is very convenient in importing/including XSLT stylesheets.

    The document() function also will resolve a relative URL in a similar way, thus making any additional XML document accessible using anrelative URL.

    Lastly, here is an example how this facilities are massively used in a big library of XSLT functions and templates (FXSL 2.x):

    
    
    
     
     
    
     
     
     
     
     
     
     
     
     
    
    
    

提交回复
热议问题