Is there a kind of include once in XSLT?

2019-07-17 22:56发布

I have FileA, FileB and FileC.

FileA includes FileB and FileC.
FileC includes FileB.

Is there an kind of include-once functionality in XSLT 1.0?

标签: xslt
2条回答
欢心
2楼-- · 2019-07-17 23:18

If you use <xsl:import> instead of <xsl:include> there would be no error.

As the W3C XSLT 1.0 specification says:

"It is an error if a stylesheet directly or indirectly imports itself. Apart from this, the case where a stylesheet with a particular URI is imported in multiple places is not treated specially."

查看更多
可以哭但决不认输i
3楼-- · 2019-07-17 23:43

You should remove the redundant xsl:include directives so each module is included only once. FileC does not need to xs:include FileB, even if it references components in FileB.

查看更多
登录 后发表回答