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; }
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); }
internal bool SetDefaultOutput(XsltOutput.OutputMethod method) { if(Output.Method != method) { this.output = this.output.CreateDerivedOutput(method); return true; } return false; }
// // 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); }
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; }