Formatting/Indenting Content Inserted by SQF Operations

Content that is inserted by the Add, Replace, or String Replace Schematron Quick Fix operations is automatically indented unless you set the value of the xml:space attribute to preserve on the operation element. There are several methods available to format the content that is inserted:
  • xsl:text - You can use an xsl:text element to format the inserted content and keep the automatic indentation, as in the following example:
    <sqf:add position="last-child">
        <row><xsl:text>
        </xsl:text>
            <entry>First column</entry><xsl:text>
            </xsl:text>
            <entry>Second column</entry><xsl:text>
            </xsl:text>
        </row><xsl:text>
        </xsl:text>
    </sqf:add>
  • xml:space - Use the xml:space attribute and set its value to preserve to format the content and specify the spacing between elements, as in the following example:
    <sqf:add node-type="element" target="codeblock" xml:space="preserve">
        /* a long sample program */
        Do forever
         Say "Hello, World"
        End</sqf:add>