Can't create XML fragments using XmlTask Transform

Feb 1, 2010 at 2:29 AM

It would be very helpful if XmlTask would expose a property to control the ConformanceLevel of the XmlWriter used for transforms (e.g. be able to specify ConformanceLevel.Fragment).

Currently, if the XSL transform would create an XML Fragment, the following will be thrown:

Using "MSBuild.ExtensionPack.Xml.XmlTask" task from assembly "d:\public\ext\MSBuild.ExtensionPack\\MSBuild.ExtensionPack.dll".
Task "MSBuild.ExtensionPack.Xml.XmlTask" (TaskId:30)
  Loading XmlFile: AssetTypeTaxonomy.xml (TaskId:30)
  Transforming: AssetTypeTaxonomy.xml (TaskId:30)
  Loading XslTransformFile: Xsl\AssetTypeTaxonomy.xsl (TaskId:30)
d:\private\dev\Localization\Catalog\src\Localization.csproj(163,5): error : InvalidOperationException: Token Text in state Start would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment. \r

Thanks, and let me know if you need more info (and thanks for all the great functionality in the Extension pack).


Feb 1, 2010 at 7:20 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.