Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextOnlyOutput.cs / 1 / 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
- VectorCollectionConverter.cs
- SqlExpander.cs
- TagPrefixAttribute.cs
- ReferenceSchema.cs
- PointValueSerializer.cs
- PasswordBoxAutomationPeer.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- BinaryObjectWriter.cs
- DiscoveryMessageSequence.cs
- RichTextBox.cs
- ValidationPropertyAttribute.cs
- RectAnimation.cs
- UpdateRecord.cs
- SystemIcmpV4Statistics.cs
- TemplateColumn.cs
- ProvideValueServiceProvider.cs
- NativeWrapper.cs
- XPathNavigatorReader.cs
- PocoPropertyAccessorStrategy.cs
- TableDetailsRow.cs
- __Filters.cs
- DesignerTransactionCloseEvent.cs
- XmlCharCheckingReader.cs
- Currency.cs
- EventRouteFactory.cs
- IndexedGlyphRun.cs
- SqlEnums.cs
- ToolStripPanelRow.cs
- SettingsSection.cs
- DataShape.cs
- InputMethodStateTypeInfo.cs
- PieceDirectory.cs
- AffineTransform3D.cs
- Vector3DCollection.cs
- RegistryPermission.cs
- SymbolMethod.cs
- XmlValueConverter.cs
- XmlUrlResolver.cs
- XPathNavigatorReader.cs
- WebPartCloseVerb.cs
- CreateUserWizardAutoFormat.cs
- CacheAxisQuery.cs
- RevocationPoint.cs
- ListBox.cs
- ObjectDataSourceMethodEditor.cs
- SynchronizedReadOnlyCollection.cs
- TextFormatter.cs
- CriticalHandle.cs
- DataGridCellsPresenter.cs
- DbConnectionPoolOptions.cs
- Constraint.cs
- WorkItem.cs
- SuppressIldasmAttribute.cs
- CodeExpressionStatement.cs
- HostSecurityManager.cs
- TraceContextRecord.cs
- Point3D.cs
- VisualBrush.cs
- CodeExporter.cs
- Pair.cs
- TreeViewEvent.cs
- XamlWriterExtensions.cs
- RegexCode.cs
- ToolboxComponentsCreatedEventArgs.cs
- SqlCommand.cs
- FileSystemInfo.cs
- RNGCryptoServiceProvider.cs
- UpdateExpressionVisitor.cs
- BindingExpressionBase.cs
- GcSettings.cs
- AnimatedTypeHelpers.cs
- METAHEADER.cs
- ProtectedConfiguration.cs
- VectorAnimation.cs
- NavigationPropertySingletonExpression.cs
- ListItemCollection.cs
- TextTreeTextNode.cs
- EnvironmentPermission.cs
- FormClosingEvent.cs
- EditorPart.cs
- VirtualPathUtility.cs
- PackagePartCollection.cs
- FieldInfo.cs
- MsmqTransportReceiveParameters.cs
- NativeMethods.cs
- SqlDataSourceDesigner.cs
- OracleSqlParser.cs
- TimeManager.cs
- ObjectSecurity.cs
- SqlClientMetaDataCollectionNames.cs
- Soap.cs
- FrameworkRichTextComposition.cs
- MaterialGroup.cs
- WorkflowTimerService.cs
- EndpointDispatcherTable.cs
- SafeUserTokenHandle.cs
- WebServiceErrorEvent.cs
- CompModSwitches.cs
- DocumentPaginator.cs
- WinFormsUtils.cs