ubiquibacon
ubiquibacon

Reputation: 10667

saxon:indent-spaces attribute is being ignored

In my question here I'm trying to pass in a param to my stylesheet so a user can specify the level of indentation desired. Apparently Xalan cannot read the value of a param into its indent-amount attribute, so I'm trying with this version of Saxon-HE instead.

Saxon has the attribute indent-spaces which I am trying to use as follows:

<xsl:stylesheet
    version="2.0"
    xmlns:saxon="http://saxon.sf.net"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <!-- <xsl:param name="indent-spaces" select="0"/> -->

    <xsl:output indent="yes" method="xml" omit-xml-declaration="yes" saxon:indent-spaces="10"/><!-- Doesn't matter what I make the value of indent-spaces, the output is always indented 3 spaces -->

Why is indent-spaces being ignored?

Upvotes: 1

Views: 2022

Answers (2)

Michael Kay
Michael Kay

Reputation: 163498

First, all Saxon extensions require Saxon-PE or higher.

Second, if you want to control serialization parameters dynamically (e.g. from a stylesheet parameter, you can do this using xsl:result-document:

<xsl:result-document indent="yes" saxon:indent-spaces="{$param}">
  ...
</xsl:result-document>

Upvotes: 1

Martin Honnen
Martin Honnen

Reputation: 167706

The namespace should be xmlns:saxon="http://saxon.sf.net/" instead of xmlns:saxon="http://saxon.sf.net".

Upvotes: 3

Related Questions