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
- SendMailErrorEventArgs.cs
- CodeTypeParameterCollection.cs
- MimeTypeMapper.cs
- ZipIOLocalFileHeader.cs
- ClientConfigurationSystem.cs
- ToolboxDataAttribute.cs
- DataServiceQueryProvider.cs
- NativeMethods.cs
- EncoderExceptionFallback.cs
- DbUpdateCommandTree.cs
- SupportingTokenSpecification.cs
- StorageSetMapping.cs
- EditorOptionAttribute.cs
- LineServicesCallbacks.cs
- HttpWebRequest.cs
- HttpListenerPrefixCollection.cs
- NoneExcludedImageIndexConverter.cs
- OleDbRowUpdatedEvent.cs
- shaper.cs
- PipelineModuleStepContainer.cs
- MemberInfoSerializationHolder.cs
- CodeNamespaceImport.cs
- FileDialogPermission.cs
- SystemMulticastIPAddressInformation.cs
- HitTestFilterBehavior.cs
- BinaryReader.cs
- wgx_render.cs
- RegisteredDisposeScript.cs
- BasePattern.cs
- Matrix3DConverter.cs
- UnsafeNativeMethods.cs
- CacheMemory.cs
- ActiveDesignSurfaceEvent.cs
- ActivityInstanceMap.cs
- DataControlFieldHeaderCell.cs
- EntityTypeBase.cs
- EntityDataSource.cs
- SqlInternalConnectionSmi.cs
- DeviceContexts.cs
- HttpApplicationStateWrapper.cs
- TemplateXamlTreeBuilder.cs
- TraceHandlerErrorFormatter.cs
- BrushConverter.cs
- RewritingSimplifier.cs
- DeviceContext.cs
- GetIndexBinder.cs
- XmlSchemaGroup.cs
- LazyTextWriterCreator.cs
- MatrixTransform.cs
- DrawingGroupDrawingContext.cs
- BinaryKeyIdentifierClause.cs
- DesignerProperties.cs
- ImageKeyConverter.cs
- SqlProviderManifest.cs
- RuntimeUtils.cs
- Pkcs7Signer.cs
- ReaderContextStackData.cs
- HostedElements.cs
- DrawingState.cs
- CodeTypeReferenceExpression.cs
- PictureBoxDesigner.cs
- DSASignatureFormatter.cs
- IRCollection.cs
- BitmapEffectRenderDataResource.cs
- EventDriven.cs
- ListChangedEventArgs.cs
- ObjectItemNoOpAssemblyLoader.cs
- BrowserDefinitionCollection.cs
- PropertyGroupDescription.cs
- Literal.cs
- PolyQuadraticBezierSegment.cs
- EventRoute.cs
- Table.cs
- CodeArrayIndexerExpression.cs
- DataGridViewLinkColumn.cs
- InputScopeManager.cs
- SystemBrushes.cs
- OletxVolatileEnlistment.cs
- CaseInsensitiveHashCodeProvider.cs
- LocatorBase.cs
- ProfileModule.cs
- IxmlLineInfo.cs
- SoapElementAttribute.cs
- DrawListViewItemEventArgs.cs
- WebBrowsableAttribute.cs
- HScrollBar.cs
- MessageVersionConverter.cs
- DataSysAttribute.cs
- AliasedExpr.cs
- SqlClientWrapperSmiStream.cs
- SQLGuidStorage.cs
- LicenseException.cs
- smtpconnection.cs
- ListSourceHelper.cs
- DataStreamFromComStream.cs
- NetSectionGroup.cs
- SymbolTable.cs
- SqlStream.cs
- Conditional.cs
- InfiniteIntConverter.cs