How to access xsl:param in an attribute of xsl:output?

后端 未结 2 1173
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 02:32

I want to allow the transformer to set a param in my stylesheet to specify how many spaces of indentation are desired. I have tried all of the suggestions by @Dimitre Novatchev

2条回答
  •  情歌与酒
    2021-01-27 02:49

    As @Mads Hansen already said it does not appear that Xalan supports attribute value templates for the value of the xalan:indent-amount attribute.

    I found that setting the property on the transformer itself does work though. The nice thing about this is that I don't have to create/modify any files.

    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    

    Credit goes to @Flynn1179

提交回复
热议问题