Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextOnlyOutput.cs / 1305376 / 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
- GenerateHelper.cs
- XmlHierarchicalDataSourceView.cs
- DataGridViewAccessibleObject.cs
- OleDbRowUpdatingEvent.cs
- UpdateProgress.cs
- QilIterator.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- ActivityStatusChangeEventArgs.cs
- TypeNameHelper.cs
- ConfigXmlComment.cs
- ComplexPropertyEntry.cs
- IdentityModelStringsVersion1.cs
- ComponentDispatcher.cs
- PermissionRequestEvidence.cs
- CodeStatement.cs
- PersonalizablePropertyEntry.cs
- Completion.cs
- WebException.cs
- TraceAsyncResult.cs
- ImageAttributes.cs
- ConfigXmlText.cs
- RelationshipEnd.cs
- PTManager.cs
- ReadOnlyPropertyMetadata.cs
- MappingItemCollection.cs
- Focus.cs
- CaseInsensitiveComparer.cs
- XmlDictionaryWriter.cs
- RoleManagerModule.cs
- altserialization.cs
- DrawListViewItemEventArgs.cs
- ItemTypeToolStripMenuItem.cs
- SqlSupersetValidator.cs
- MemberDomainMap.cs
- SqlUserDefinedAggregateAttribute.cs
- JpegBitmapEncoder.cs
- BamlResourceContent.cs
- Margins.cs
- EditorPartCollection.cs
- Command.cs
- IndexExpression.cs
- SystemTcpStatistics.cs
- ActionMessageFilterTable.cs
- DiscoveryVersionConverter.cs
- VariableQuery.cs
- Input.cs
- TextTreeUndoUnit.cs
- CharEnumerator.cs
- EventSinkHelperWriter.cs
- WindowsButton.cs
- OpenTypeLayoutCache.cs
- _AuthenticationState.cs
- AdRotator.cs
- UrlPath.cs
- COM2AboutBoxPropertyDescriptor.cs
- XmlExceptionHelper.cs
- DependencyPropertyAttribute.cs
- EntityClassGenerator.cs
- SemanticValue.cs
- PolyQuadraticBezierSegment.cs
- UpdateCompiler.cs
- DataErrorValidationRule.cs
- ToolStripComboBox.cs
- TypeLibConverter.cs
- PieceNameHelper.cs
- SecurityContextSecurityTokenResolver.cs
- TableAutomationPeer.cs
- EdgeModeValidation.cs
- LineGeometry.cs
- SqlGatherProducedAliases.cs
- SByte.cs
- SocketException.cs
- CollectionView.cs
- InstanceDataCollection.cs
- DataGrid.cs
- PropertyCollection.cs
- IntSecurity.cs
- EntityDataSourceContextDisposingEventArgs.cs
- XmlSchemaCollection.cs
- MaskedTextProvider.cs
- EraserBehavior.cs
- MemberPathMap.cs
- ThicknessAnimation.cs
- PeerNameRecord.cs
- MultiTrigger.cs
- XmlQueryStaticData.cs
- ExportOptions.cs
- ImplicitInputBrush.cs
- FlowLayoutPanel.cs
- returneventsaver.cs
- RootAction.cs
- AnnotationStore.cs
- TripleDES.cs
- SmtpAuthenticationManager.cs
- ComboBoxItem.cs
- GenerateScriptTypeAttribute.cs
- MessageQueueCriteria.cs
- EntityCommandDefinition.cs
- MemberHolder.cs
- VirtualDirectoryMappingCollection.cs