Bug 2917 - XslCompiledTransform.Load ignoring xsl:output properties
Summary: XslCompiledTransform.Load ignoring xsl:output properties
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: 2.10.x
Hardware: PC Windows
: --- enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-16 14:48 UTC by Tom Hindle
Modified: 2015-11-26 08:54 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case showing XslCompiledTransform ignoring xsl:output properties. (872 bytes, text/plain)
2012-01-16 14:48 UTC, Tom Hindle
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Tom Hindle 2012-01-16 14:48:07 UTC
Created attachment 1205 [details]
Test case showing XslCompiledTransform ignoring xsl:output properties.

XslCompiledTransform Load method should populate its XmlWritingSettings OutputSettings property by reading <xsl:output> properties.

Attached is a simple test case showing the indent property being ignored.
Comment 1 Atsushi Eno 2012-01-19 07:09:02 UTC
This XmlWriterSettings is never used in our XslCompiledTransform which is not really a compiled XSL transform engine that was rewritten from scratch in .NET. We just dispatch most of the things in classic XslTransform and this does not accept XmlWriterSettings (especially for non-xml outputs). Filling XmlWriterSettings property is not something impossible, but that does not make real sense in current state.

Since we mark OutputSettings property as [MonoTODO], this would be taken care after someone writes XSLT compiler and/or upgrade this XslCompiledTransform class to take this settings into consideration. => setting as Enhancemnet.
Comment 2 Atsushi Eno 2015-03-17 06:25:39 UTC
The latest mono master imports referencesource and it compatible with .NET, giving the expected results.
Comment 3 Alex Solovyov 2015-11-26 04:44:43 UTC
Looks like this bug still exists and has deeper roots, encountered in MONO 4.2.1.
Comment 4 Atsushi Eno 2015-11-26 08:54:13 UTC
That shouldn't happen:

atsushi:~$ tail test.cs
			

			var xmlReader = XmlReader.Create(new StringReader(xsl));
			xslCompiledTransform.Load(xmlReader);

			// Returns true on .NET and False on mono 2.10.2
			Console.WriteLine(xslCompiledTransform.OutputSettings.Indent);
		}
	}
}
atsushi:~$ mcs test.cs
atsushi:~$ mono test.exe 
True


----

Note that you cannot get referencesource behavior on mobiles. Never (WONTFIX). XslCompiledTransform is based on dynamic code generation. It will fall back to XslTransform.