What is the difference between using XSLT and declaring elements literally?

后端 未结 4 1305
旧时难觅i
旧时难觅i 2020-12-20 20:59

I have started using XSLT just recently and am wondering what the effective difference is between using for defining elements vs. just decla

4条回答
  •  悲&欢浪女
    2020-12-20 21:32

    One other technical difference not yet noted in the answers: if you restrict yourself to the xsl:element constructor, your stylesheet can be valid against the DTD for XSLT. In some environments (where you have a DTD-aware editor, for example) that can be advantageous. That said, I have been told many times that no one actually uses a DTD to guide their XSLT construction (except me, that is).

    There is also a metaphysical difference (literal result elements can be viewed as a form of tag abuse, because you're using an h1 where the meaning is not "this is a first-level heading" but instead "put a first-level heading here"), but this is of interest primarily to markup theorists and language designers; I mention it only for completeness' sake.

提交回复
热议问题