Exemple #1
0
        private void Init(XPathDocument xpDoc, FileAccess mode, bool strict, params string[] pageNames)
        {
            if (mode != FileAccess.Read)
            {
                throw new IOException(mode.ToString() + " not supported");
            }

            XsltArgumentList xslArgs = new XsltArgumentList();

            if (pageNames.Length > 0)
            {
                string pageNameList = "|";
                foreach (string pageName in pageNames)
                {
                    pageNameList += (pageName + "|");
                }
                xslArgs.AddParam("selected-pages", String.Empty, pageNameList);
            }


            XslTransform xslt = new XslTransform();

            // select the appropriate XSL
            string xslName = strict?"strict-vdx2nxbre-ie.xsl":"vdx2nxbre-ie.xsl";

            xslt.Load(new XPathDocument(Assembly.GetExecutingAssembly().GetManifestResourceStream(Parameter.GetString(xslName, xslName))),
                      null,
                      null);

            MemoryStream stream = new MemoryStream();

            xslt.Transform(xpDoc, xslArgs, stream, null);
            stream.Seek(0, SeekOrigin.Begin);
            rml086da = new RuleML086NafDatalogAdapter(stream, FileAccess.Read);
        }
Exemple #2
0
        private void Init(XPathDocument xpDoc, FileAccess mode, bool strict, params string[] pageNames)
        {
            if (mode != FileAccess.Read) throw new IOException(mode.ToString() + " not supported");

            XsltArgumentList xslArgs = new XsltArgumentList();
            if (pageNames.Length > 0) {
                string pageNameList = "|";
                foreach(string pageName in pageNames) pageNameList += (pageName + "|");
                xslArgs.AddParam("selected-pages", String.Empty, pageNameList);
            }

            XslTransform xslt = new XslTransform();

            // select the appropriate XSL
            string xslName = strict?"strict-vdx2nxbre-ie.xsl":"vdx2nxbre-ie.xsl";

            xslt.Load(new XPathDocument(Assembly.GetExecutingAssembly().GetManifestResourceStream(Parameter.GetString(xslName, xslName))),
                      null,
                      null);

            MemoryStream stream = new MemoryStream();
            xslt.Transform(xpDoc, xslArgs, stream, null);
            stream.Seek(0, SeekOrigin.Begin);
            rml086da = new RuleML086NafDatalogAdapter(stream, FileAccess.Read);
        }