Skip to content

Commit

Permalink
Fix XmlException when writing Html log with certain test names (#4576)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmoseley committed Jun 28, 2023
1 parent ed80b71 commit f6517a0
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -28,6 +28,13 @@ public HtmlTransformer()
/// </summary>
public void Transform(string xmlFile, string htmlFile)
{
_xslTransform.Transform(xmlFile, htmlFile);

// DCS happily serializes characters into character references that are not strictly valid XML,
// for example &#xFFFF;. DCS will load them, but for XSL to load them here we need to pass it
// a reader that we've configured to be tolerant of such references.
using XmlReader xr = XmlReader.Create(xmlFile, new XmlReaderSettings() { CheckCharacters = false });
using XmlWriter xw = XmlWriter.Create(htmlFile, new XmlWriterSettings() { CheckCharacters = false });

_xslTransform.Transform(xr, xw);
}
}

0 comments on commit f6517a0

Please sign in to comment.