XSLT conditional include of external file

后端 未结 8 2069
情书的邮戳
情书的邮戳 2020-12-20 20:14

I want to perform a conditional include in XSLT, but xsl:include is a top level element. You can only use xsl:if or xsl:choose inside of a template. Is there any kind of hac

8条回答
  •  离开以前
    2020-12-20 20:46

    
    
    

    This example is how I did a conditional use of an external file. I had the flag in the base XML that the XSL uses as a variable to help specify the name of the other file to pull into the template. Once that variable is defined as in my case I use it to pull other XML data into the generated output. The concat command forces the data together to give a file name.

    So When I want info from the external XML file I use '$DOCUMENTNAME' for referencing the external data.

提交回复
热议问题