##// END OF EJS Templates
Fixed promise rejection when there is not specified error handler in the reaction....
Fixed promise rejection when there is not specified error handler in the reaction. FIXED SPELLING IN THE XML CONTAINER CONFIGURATION signleton->singleton Code cleanup Update tests make them working on dotnet core

File last commit:

r295:28af686e24f7 default
r295:28af686e24f7 default
Show More
XmlToJson.cs
30 lines | 926 B | text/x-csharp | CSharpLexer
using System.IO;
using System.Reflection;
using System.Xml;
using System.Xml.Xsl;
using Implab.Components;
namespace Implab.Xml {
public class XmlToJson {
const string XmlToJsonTransformId = "Implab.Xml.json.xsl";
static LazyAndWeak<XslCompiledTransform> m_default = new LazyAndWeak<XslCompiledTransform>(CreateTransform, true);
public static XslCompiledTransform Default {
get { return m_default.Value; }
}
protected static XslCompiledTransform CreateTransform() {
var transform = new XslCompiledTransform();
using(var reader = XmlReader.Create(GetDefaultTransform())) {
transform.Load(reader);
}
return transform;
}
protected static Stream GetDefaultTransform() {
return Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlToJsonTransformId);
}
}
}