zoukankan      html  css  js  c++  java
  • MathML转换成OfficeML

    
    
      public XslCompiledTransform XslTransforms;
                XslTransforms = new XslCompiledTransform();
                XslTransforms.Load(@"D:DocEditorMicrosoft OfficeOffice14MML2OMML.xsl");
        





    // The MML2OMML.xsl file is located under // %ProgramFiles%Microsoft OfficeOffice12 /// <summary> /// 获取键值hash /// </summary> /// <param name="Docurl"></param> /// <param name="MathMl"></param> /// <returns></returns> public IDictionary<String,OpenXmlElement> GetOMMLHash(IDictionary<string, string> MathML) { IDictionary<String, OpenXmlElement> Currentresult=new Dictionary<string,OpenXmlElement>(); foreach (var MMLname in MathML.Keys) { // Load the file containing your MathML presentation markup. using (XmlReader reader = XmlReader.Create(new StringReader(MathML[MMLname]))) { using (MemoryStream ms = new MemoryStream()) { XmlWriterSettings settings = XslTransforms.OutputSettings.Clone(); // Configure xml writer to omit xml declaration. settings.ConformanceLevel = ConformanceLevel.Fragment; settings.OmitXmlDeclaration = true; XmlWriter xw = XmlWriter.Create(ms, settings); // Transform our MathML to OfficeMathML XslTransforms.Transform(reader, xw); ms.Seek(0, SeekOrigin.Begin); StreamReader sr = new StreamReader(ms, Encoding.UTF8); string officeML = sr.ReadToEnd(); // Create a OfficeMath instance from the // OfficeMathML xml. DocumentFormat.OpenXml.Math.OfficeMath omml = new DocumentFormat.OpenXml.Math.OfficeMath(officeML); Currentresult[MMLname] = omml; } } } return Currentresult; }
  • 相关阅读:
    数据结构与算法题目集(中文)6-12 二叉搜索树的操作集 (30分)
    性能测试案例
    jmeter 常用监听器
    性能测试面试题
    jmeter 之 dubbo
    jmeter5 分布式测试,未成功
    jmeter之OPMS项目管理参数化与断言实战;
    jmeter时间戳处理相关
    jmeter控制器下遍历一组参数
    The Wall (medium)
  • 原文地址:https://www.cnblogs.com/daxiongblog/p/4941652.html
Copyright © 2011-2022 走看看