Ejemplo n.º 1
0
        static void xsltTransform(string inputPath, string outputPath, string xsltPath)
        {
            XmlUrlResolver  resolver      = new XmlUrlResolver();
            XsltSettings    xsltSettings  = new XsltSettings(true, true);
            MxmlTextWriter  mxmlWriter    = mxmlWriter = new MxmlTextWriter(outputPath, null, true);
            XmlInput        input         = new XmlInput(inputPath);
            MvpXslTransform mxmlTransform = new MvpXslTransform();

            mxmlTransform.Load(xsltPath, xsltSettings, resolver);
            mxmlTransform.Transform(input, null, new XmlOutput(mxmlWriter));

            mxmlWriter.Flush();
            mxmlWriter.Close();
            mxmlWriter = null;
        }
Ejemplo n.º 2
0
        static void finalMxmlWriter(string inputPath, string outputPath)
        {
            // write final output with disabled comments
            MxmlDocument doc = new MxmlDocument();

            doc.PreserveWhitespace = true;
            doc.Load(inputPath);
            doc.Format(outputTarPath + "mxml/");
            MxmlTextWriter mxmlWriter = new MxmlTextWriter(outputPath, null, true);

            doc.WriteTo(mxmlWriter);

            mxmlWriter.Flush();
            mxmlWriter.Close();
            mxmlWriter = null;
        }
Ejemplo n.º 3
0
        static void xsltFormatTransform(string inputPath, string outputPath, string xsltPath)
        {
            XmlUrlResolver  resolver      = new XmlUrlResolver();
            XsltSettings    xsltSettings  = new XsltSettings(true, true);
            MxmlTextWriter  mxmlWriter    = mxmlWriter = new MxmlTextWriter(outputPath, null, true);
            XmlInput        input         = new XmlInput(inputPath);
            MvpXslTransform mxmlTransform = new MvpXslTransform();

            mxmlWriter.Formatting  = Formatting.Indented;
            mxmlWriter.IndentChar  = '\t';
            mxmlWriter.Indentation = 1;
            mxmlWriter.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
            mxmlWriter.WriteRaw("<?xml-stylesheet type=\"text/xsl\" href=\"../../../material/css/" + BookName + "/" + BookName + ".css\"?>\n");

            mxmlWriter.WriteRaw("<!DOCTYPE book SYSTEM \"" + commonSrc + "mxml/dtd/mxml.dtd\">\n");

            mxmlTransform.Load(xsltPath, xsltSettings, resolver);
            mxmlTransform.Transform(input, null, new XmlOutput(mxmlWriter));

            mxmlWriter.Flush();
            mxmlWriter.Close();
            mxmlWriter = null;
        }