i'm using a stylesheet to create a adobe xfdf file. the spec from adobe claims that the xml:space attribute is required and the value must be preserve. so i tried to use
The result of the transformation was that the content of this xfdf node preserved the whitespaces. i wonder why saxon reacts to this attribute, because it is inside of the result document.
Using this syntax:
<xsl:template match="/root">
<xfdf-head>
<xfdf xmlns="http://ns.adobe.com/xfdf/">
<xsl:attribute name="xml:space">preserve</xsl:attribute>
...
the content whitespaces are NOT preserved.
I don't understand what's the difference between the two alternatives. shouldn't they generate the same result ?
thanx for light
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First, sorry for not responding earlier. I don't get notified of messages on this forum. The forum seems to have recently reappeared with changes to the Sourceforge GUI, and I hadn't noticed it.
Second, general XSLT coding questions are best asked on the xsl-list at mulberrytech.com.
The presence of xml:space='preserve' in the result file affects the serializer: when indenting is in use, the indenter must not add or remove whitespace in a section of the document controlled by this attribute.
Michael Kay
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
i'm using a stylesheet to create a adobe xfdf file. the spec from adobe claims that the xml:space attribute is required and the value must be preserve. so i tried to use
<xsl:template match="/root">
<xfdf-head>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space='preserve'>
...
The result of the transformation was that the content of this xfdf node preserved the whitespaces. i wonder why saxon reacts to this attribute, because it is inside of the result document.
Using this syntax:
<xsl:template match="/root">
<xfdf-head>
<xfdf xmlns="http://ns.adobe.com/xfdf/">
<xsl:attribute name="xml:space">preserve</xsl:attribute>
...
the content whitespaces are NOT preserved.
I don't understand what's the difference between the two alternatives. shouldn't they generate the same result ?
thanx for light
First, sorry for not responding earlier. I don't get notified of messages on this forum. The forum seems to have recently reappeared with changes to the Sourceforge GUI, and I hadn't noticed it.
Second, general XSLT coding questions are best asked on the xsl-list at mulberrytech.com.
The presence of xml:space='preserve' in the result file affects the serializer: when indenting is in use, the indenter must not add or remove whitespace in a section of the document controlled by this attribute.
Michael Kay