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
- Triangle.cs
- StrokeCollectionDefaultValueFactory.cs
- BorderGapMaskConverter.cs
- DocumentPropertiesDialog.cs
- CloseCryptoHandleRequest.cs
- LoadRetryAsyncResult.cs
- Metafile.cs
- ObjectComplexPropertyMapping.cs
- XmlDataSourceView.cs
- ServerType.cs
- Int32Converter.cs
- TypeInfo.cs
- CodeDOMProvider.cs
- TemplateBuilder.cs
- Item.cs
- SQLSingle.cs
- AsyncSerializedWorker.cs
- XmlComment.cs
- SiteMapDataSourceView.cs
- AsnEncodedData.cs
- unitconverter.cs
- MexHttpBindingElement.cs
- DesignerTextBoxAdapter.cs
- UTF7Encoding.cs
- SiblingIterators.cs
- InstanceLockException.cs
- SoapTypeAttribute.cs
- RepeatEnumerable.cs
- ISFTagAndGuidCache.cs
- TabItemWrapperAutomationPeer.cs
- Hashtable.cs
- SafeTimerHandle.cs
- UpdateProgress.cs
- DetailsViewInsertEventArgs.cs
- PenContexts.cs
- GraphicsState.cs
- HtmlForm.cs
- PasswordTextNavigator.cs
- WebServiceTypeData.cs
- PathFigure.cs
- PageCodeDomTreeGenerator.cs
- ManifestBasedResourceGroveler.cs
- DigestTraceRecordHelper.cs
- CriticalExceptions.cs
- LowerCaseStringConverter.cs
- InputLanguageCollection.cs
- TypeUsage.cs
- FontStretches.cs
- DefaultCommandConverter.cs
- XmlObjectSerializerReadContextComplex.cs
- AssertFilter.cs
- FileIOPermission.cs
- ObjectCloneHelper.cs
- EventlogProvider.cs
- DelegatingHeader.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ParseElementCollection.cs
- XmlReturnReader.cs
- SafeRightsManagementQueryHandle.cs
- KeyEvent.cs
- CommentGlyph.cs
- TreeViewHitTestInfo.cs
- WebPartCatalogCloseVerb.cs
- GetPageCompletedEventArgs.cs
- Vector3D.cs
- BooleanFacetDescriptionElement.cs
- ConnectionStringSettings.cs
- TriggerAction.cs
- basemetadatamappingvisitor.cs
- ZipPackage.cs
- PlacementWorkspace.cs
- ToolstripProfessionalRenderer.cs
- ZipFileInfo.cs
- OracleConnectionString.cs
- TextComposition.cs
- CodePageEncoding.cs
- UniqueTransportManagerRegistration.cs
- StatusBarPanel.cs
- ListControlConvertEventArgs.cs
- DocumentGridPage.cs
- DBCSCodePageEncoding.cs
- StringUtil.cs
- ControlParameter.cs
- SqlLiftWhereClauses.cs
- PreservationFileWriter.cs
- VirtualPathProvider.cs
- RefreshPropertiesAttribute.cs
- DeferredSelectedIndexReference.cs
- FileLoadException.cs
- Emitter.cs
- XmlExtensionFunction.cs
- QilNode.cs
- CompiledRegexRunnerFactory.cs
- WebPartMinimizeVerb.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- XmlSchemaAnnotation.cs
- PropertyGridView.cs
- ValidationPropertyAttribute.cs
- ActivationWorker.cs
- CollectionViewGroupInternal.cs