Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XmlParserContext.cs
- HttpCacheParams.cs
- _NetworkingPerfCounters.cs
- TdsRecordBufferSetter.cs
- Suspend.cs
- CollectionBuilder.cs
- SecurityDocument.cs
- Utils.cs
- SimpleHandlerBuildProvider.cs
- JoinGraph.cs
- ActivityBindForm.Designer.cs
- SafeHandles.cs
- MenuStrip.cs
- SingleAnimationBase.cs
- OleTxTransaction.cs
- CustomAttributeSerializer.cs
- HealthMonitoringSectionHelper.cs
- SafeArrayTypeMismatchException.cs
- IDQuery.cs
- WinEventHandler.cs
- Signature.cs
- ScalarConstant.cs
- XmlText.cs
- ObjectStateEntryDbDataRecord.cs
- SHA256.cs
- SQLBinary.cs
- PolygonHotSpot.cs
- XmlSignatureManifest.cs
- UserControlBuildProvider.cs
- DispatcherTimer.cs
- EntitySqlQueryCacheKey.cs
- AliasedExpr.cs
- ProfileInfo.cs
- ExpressionsCollectionEditor.cs
- XmlNodeComparer.cs
- BitConverter.cs
- XmlWellformedWriter.cs
- SoapMessage.cs
- UnaryNode.cs
- DependsOnAttribute.cs
- IIS7WorkerRequest.cs
- RightsManagementPermission.cs
- ContentElement.cs
- ColumnCollection.cs
- XpsS0ValidatingLoader.cs
- RunWorkerCompletedEventArgs.cs
- AuthStoreRoleProvider.cs
- XmlDataImplementation.cs
- KeyboardEventArgs.cs
- DataGridViewCellStyle.cs
- Cursors.cs
- MetaModel.cs
- OdbcConnectionFactory.cs
- SecurityKeyIdentifier.cs
- _KerberosClient.cs
- VisualStyleTypesAndProperties.cs
- FixedTextView.cs
- MonikerBuilder.cs
- PeerResolverSettings.cs
- SiteMapNodeItem.cs
- KeyGestureConverter.cs
- SynchronizationValidator.cs
- HTMLTagNameToTypeMapper.cs
- SelectionEditor.cs
- LicenseContext.cs
- OracleInfoMessageEventArgs.cs
- InvokeBinder.cs
- Span.cs
- CookielessHelper.cs
- MenuScrollingVisibilityConverter.cs
- VisualProxy.cs
- DataGridViewSelectedColumnCollection.cs
- XmlSerializationWriter.cs
- ButtonFieldBase.cs
- BindingContext.cs
- XamlToRtfParser.cs
- Vector.cs
- SHA1CryptoServiceProvider.cs
- AnimationClock.cs
- WebPartsPersonalizationAuthorization.cs
- ProfileInfo.cs
- JsonGlobals.cs
- HeaderCollection.cs
- EncoderReplacementFallback.cs
- SettingsProperty.cs
- GeneralTransform3D.cs
- Style.cs
- ListDataHelper.cs
- OutputCacheSettings.cs
- GridLengthConverter.cs
- EventProperty.cs
- StringCollectionEditor.cs
- PresentationAppDomainManager.cs
- TypeElement.cs
- Subtree.cs
- IdentityHolder.cs
- AnimationException.cs
- CodeCompiler.cs
- EnumValidator.cs
- CreateUserWizardDesigner.cs