Preserving entity references when transforming XML with XSLT?

后端 未结 5 691
旧巷少年郎
旧巷少年郎 2020-11-30 15:06

How can I preserve entity references when transforming XML with XSLT (2.0)? With all of the processors I\'ve tried, the entity gets resolved by default. I can use xsl:

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 15:48

    This can be an especially troublesome issue if you are using something like S1000D. It uses entities and @boardno attributes to link to figures. It's a throwback to its SGML roots.

    Because this automatic entity expanding behavior, which is correct but undesireable, I often have to drop back to tools like sed, awk and batch scripts to manage certain data analysis tasks when using S1000D as input.

    IMHO, this would be a great change proposal to one of the upcoming XSLT specifications that a compliant processor accept a runtime parameter that can turn on and off entitiy expansions.

提交回复
热议问题