예제 #1
0
 private void CacheOuptutProps(XsltOutput output)
 {
     this.output        = output;
     this.isXmlOutput   = this.output.Method == XsltOutput.OutputMethod.Xml;
     this.isHtmlOutput  = this.output.Method == XsltOutput.OutputMethod.Html;
     this.cdataElements = this.output.CDataElements;
     this.indentOutput  = this.output.Indent;
     this.outputDoctype = this.output.DoctypeSystem != null || (this.isHtmlOutput && this.output.DoctypePublic != null);
     this.outputXmlDecl = this.isXmlOutput && !this.output.OmitXmlDeclaration && !this.omitXmlDeclCalled;
 }
예제 #2
0
        internal XsltOutput CreateDerivedOutput(OutputMethod method)
        {
            XsltOutput output = (XsltOutput)MemberwiseClone();

            output.method = method;
            if (method == OutputMethod.Html && this.indentSId == int.MaxValue)   // HTML output and Ident wasn't specified
            {
                output.indent = true;
            }
            return(output);
        }
예제 #3
0
파일: processor.cs 프로젝트: ArildF/masters
 internal bool SetDefaultOutput(XsltOutput.OutputMethod method) {
     if(Output.Method != method) {
         this.output = this.output.CreateDerivedOutput(method);
         return true;
     }
     return false;
 }
예제 #4
0
파일: processor.cs 프로젝트: ArildF/masters
        //
        // Construction
        //

        private Processor(XPathNavigator doc, XsltArgumentList args, XmlResolver resolver, XslTransform transform) {
            transform.LoadCompiledStylesheet(out this.stylesheet, out this.queryList, out this.queryStore, out this.rootAction, doc);

            this.xsm                 = new StateMachine();
            this.document            = doc;
            this.builder             = null;
            this.actionStack         = new HWStack(StackIncrement, /*limit:*/1000);
            this.output              = this.rootAction.Output;
            this.resolver            = resolver != null ? resolver : new XmlUrlResolver();
            this.args                = args     != null ? args     : new XsltArgumentList();
            this.debugger            = transform.Debugger;
            if (this.debugger != null) {
                this.debuggerStack = new HWStack(StackIncrement, /*limit:*/1000);
                templateLookup     = new TemplateLookupActionDbg();
            }
            
            this.scriptExtensions = new Hashtable(this.stylesheet.ScriptObjectTypes.Count); {
                foreach(DictionaryEntry entry in this.stylesheet.ScriptObjectTypes) {
                    string namespaceUri = (string)entry.Key;
                    if (GetExtensionObject(namespaceUri) != null) {
	                    throw new XsltException(Res.Xslt_ScriptDub, namespaceUri);
                    }
                    scriptExtensions.Add(namespaceUri, Activator.CreateInstance((Type)entry.Value,
                        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null));
                }
            }
            
            this.PushActionFrame(this.rootAction, /*nodeSet:*/null);
        }
예제 #5
0
 private void CacheOuptutProps(XsltOutput output) {
     this.output        = output;
     this.isXmlOutput   = this.output.Method == XsltOutput.OutputMethod.Xml;
     this.isHtmlOutput  = this.output.Method == XsltOutput.OutputMethod.Html;
     this.cdataElements = this.output.CDataElements;
     this.indentOutput  = this.output.Indent;
     this.outputDoctype = this.output.DoctypeSystem != null || (this.isHtmlOutput && this.output.DoctypePublic != null);
     this.outputXmlDecl = this.isXmlOutput && ! this.output.OmitXmlDeclaration && ! this.omitXmlDeclCalled;
 }