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
- CompilerScope.Storage.cs
- ProcessModelInfo.cs
- LayoutEditorPart.cs
- IdentitySection.cs
- XmlResolver.cs
- TraceRecords.cs
- DecimalStorage.cs
- SafePointer.cs
- TypeElement.cs
- ContentDesigner.cs
- CacheOutputQuery.cs
- TraceUtils.cs
- SimpleType.cs
- VectorValueSerializer.cs
- MimePart.cs
- ObjectDataSource.cs
- XmlAttribute.cs
- XmlResolver.cs
- SqlUnionizer.cs
- XmlDataCollection.cs
- AuthenticationService.cs
- WebPartEditVerb.cs
- TagPrefixAttribute.cs
- DesigntimeLicenseContextSerializer.cs
- CustomCategoryAttribute.cs
- ArgumentException.cs
- Metadata.cs
- ThreadStateException.cs
- ProfilePropertySettings.cs
- SafeRightsManagementSessionHandle.cs
- Int32.cs
- SynchronizationLockException.cs
- PaintValueEventArgs.cs
- SqlProcedureAttribute.cs
- CalendarDayButton.cs
- DesignerSerializationOptionsAttribute.cs
- DiscoveryUtility.cs
- DeleteBookmarkScope.cs
- EnumerableWrapperWeakToStrong.cs
- SimpleBitVector32.cs
- BrushValueSerializer.cs
- HandledEventArgs.cs
- ImmComposition.cs
- InstallerTypeAttribute.cs
- TypeToTreeConverter.cs
- DataGridViewImageColumn.cs
- SystemColorTracker.cs
- HashHelper.cs
- PageTheme.cs
- MachineSettingsSection.cs
- DateTimeValueSerializer.cs
- ObjectListCommandCollection.cs
- TypeDescriptor.cs
- BooleanFunctions.cs
- ValidationContext.cs
- MetadataArtifactLoaderCompositeResource.cs
- PrimitiveList.cs
- NavigationPropertyEmitter.cs
- _FtpControlStream.cs
- DrawingContextWalker.cs
- CompilerTypeWithParams.cs
- XPathCompileException.cs
- TagMapCollection.cs
- FileCodeGroup.cs
- C14NUtil.cs
- JsonWriter.cs
- InfoCardBinaryReader.cs
- WebPageTraceListener.cs
- ScrollBarRenderer.cs
- HttpResponseBase.cs
- VectorCollection.cs
- AttributedMetaModel.cs
- MemoryPressure.cs
- NamedPermissionSet.cs
- ScrollEvent.cs
- RoleManagerSection.cs
- ParserStack.cs
- XmlNamedNodeMap.cs
- wgx_commands.cs
- WebPartTransformerCollection.cs
- CapabilitiesRule.cs
- MethodSet.cs
- XmlDocumentSchema.cs
- MetaDataInfo.cs
- RowCache.cs
- namescope.cs
- TextElementCollectionHelper.cs
- SelectionManager.cs
- ReadOnlyHierarchicalDataSource.cs
- SqlCacheDependencyDatabase.cs
- HtmlLink.cs
- ipaddressinformationcollection.cs
- AppDomainEvidenceFactory.cs
- Group.cs
- ConnectorMovedEventArgs.cs
- CanExpandCollapseAllConverter.cs
- WebPartAuthorizationEventArgs.cs
- XmlSchemaInclude.cs
- HWStack.cs
- WindowsNonControl.cs