Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextOnlyOutput.cs / 1305376 / TextOnlyOutput.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.IO; using System.Xml; using System.Xml.XPath; using System.Text; using System.Collections; internal class TextOnlyOutput : RecordOutput { private Processor processor; private TextWriter writer; internal XsltOutput Output { get { return this.processor.Output; } } public TextWriter Writer { get { return this.writer; } } // // Constructor // internal TextOnlyOutput(Processor processor, Stream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } this.processor = processor; this.writer = new StreamWriter(stream, Output.Encoding); } internal TextOnlyOutput(Processor processor, TextWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } this.processor = processor; this.writer = writer; } // // RecordOutput interface method implementation // public Processor.OutputResult RecordDone(RecordBuilder record) { BuilderInfo mainNode = record.MainNode; switch (mainNode.NodeType) { case XmlNodeType.Text: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: this.writer.Write(mainNode.Value); break; default: break; } record.Reset(); return Processor.OutputResult.Continue; } public void TheEnd() { this.writer.Flush(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.IO; using System.Xml; using System.Xml.XPath; using System.Text; using System.Collections; internal class TextOnlyOutput : RecordOutput { private Processor processor; private TextWriter writer; internal XsltOutput Output { get { return this.processor.Output; } } public TextWriter Writer { get { return this.writer; } } // // Constructor // internal TextOnlyOutput(Processor processor, Stream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } this.processor = processor; this.writer = new StreamWriter(stream, Output.Encoding); } internal TextOnlyOutput(Processor processor, TextWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } this.processor = processor; this.writer = writer; } // // RecordOutput interface method implementation // public Processor.OutputResult RecordDone(RecordBuilder record) { BuilderInfo mainNode = record.MainNode; switch (mainNode.NodeType) { case XmlNodeType.Text: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: this.writer.Write(mainNode.Value); break; default: break; } record.Reset(); return Processor.OutputResult.Continue; } public void TheEnd() { this.writer.Flush(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MimeReflector.cs
- EntityConnectionStringBuilderItem.cs
- LayoutUtils.cs
- ConstructorNeedsTagAttribute.cs
- NamespaceTable.cs
- WebBrowserContainer.cs
- OLEDB_Util.cs
- PlaceHolder.cs
- Behavior.cs
- EnumCodeDomSerializer.cs
- ProcessHostMapPath.cs
- DropShadowBitmapEffect.cs
- RegularExpressionValidator.cs
- SmtpClient.cs
- DataReceivedEventArgs.cs
- LogicalExpr.cs
- TextChangedEventArgs.cs
- RetrieveVirtualItemEventArgs.cs
- AccessibilityHelperForVista.cs
- ObservableDictionary.cs
- TimeStampChecker.cs
- MenuItemStyleCollection.cs
- ScriptControlManager.cs
- WpfXamlLoader.cs
- SmtpCommands.cs
- TokenBasedSet.cs
- DoubleConverter.cs
- WindowsGraphics2.cs
- DeclarativeCatalogPart.cs
- DeferredReference.cs
- BasicViewGenerator.cs
- DocumentApplicationJournalEntry.cs
- X509DefaultServiceCertificateElement.cs
- Single.cs
- KeyGesture.cs
- DocumentXmlWriter.cs
- SingleTagSectionHandler.cs
- securitycriticaldata.cs
- WindowsClientElement.cs
- DataServiceQueryProvider.cs
- ToolStripAdornerWindowService.cs
- DiffuseMaterial.cs
- SignatureHelper.cs
- MLangCodePageEncoding.cs
- PanelDesigner.cs
- ReadOnlyDataSourceView.cs
- JoinTreeNode.cs
- QueryContinueDragEvent.cs
- Int64KeyFrameCollection.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- Tokenizer.cs
- DetailsViewPagerRow.cs
- FloaterParaClient.cs
- BooleanToVisibilityConverter.cs
- SqlBooleanizer.cs
- TextElementCollectionHelper.cs
- ObjectDataSourceFilteringEventArgs.cs
- OdbcConnectionStringbuilder.cs
- CryptoApi.cs
- Knowncolors.cs
- QuaternionConverter.cs
- ItemsPanelTemplate.cs
- WebPartConnectionsDisconnectVerb.cs
- ReaderOutput.cs
- AliasedSlot.cs
- Vertex.cs
- WebUtil.cs
- TypeDependencyAttribute.cs
- DateTimeConverter2.cs
- _DomainName.cs
- UIElement.cs
- ButtonColumn.cs
- PropertySourceInfo.cs
- DashStyles.cs
- AsyncResult.cs
- Win32Exception.cs
- PropertyBuilder.cs
- PropertyNames.cs
- OdbcConnectionOpen.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ComponentDispatcher.cs
- SqlCaseSimplifier.cs
- Win32SafeHandles.cs
- TableSectionStyle.cs
- EdmToObjectNamespaceMap.cs
- DmlSqlGenerator.cs
- WebPartConnection.cs
- DataSourceControlBuilder.cs
- cookiecontainer.cs
- DeclaredTypeValidator.cs
- XPathAxisIterator.cs
- ListCollectionView.cs
- MetadataFile.cs
- GifBitmapDecoder.cs
- BulletDecorator.cs
- TransactionFilter.cs
- BaseUriHelper.cs
- InkCanvas.cs
- ConditionalExpression.cs
- XmlDocumentSerializer.cs