Using dynamic href in XSLT import/include?

后端 未结 2 1790
醉酒成梦
醉酒成梦 2021-01-23 03:59

The and elements seem to behave quite specific. What I am trying to do:



        
2条回答
  •  爱一瞬间的悲伤
    2021-01-23 04:47

    xsl:import assembles the stylesheet prior to execution. The stylesheet can't modify itself while it is executing, which is what you are trying to achieve.

    If you have three variants of a stylesheet for use in different circumstances, represented by three modules A.xsl, B.xsl, and C.xsl, then instead of trying to import one of these into the module common.xsl that contains all the common code, you need to invert the structure: each of A.xsl, B.xsl, and C.xsl should import common.xsl, and you should select A.xsl, B.xsl, or C.xsl as the principal stylesheet module when initiating the transformation.

提交回复
热议问题