Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DbProviderFactoriesConfigurationHandler.cs
- ReadWriteSpinLock.cs
- SelfIssuedTokenFactoryCredential.cs
- ZoneButton.cs
- EditCommandColumn.cs
- PackWebRequestFactory.cs
- CommonXSendMessage.cs
- RawContentTypeMapper.cs
- HtmlTableRowCollection.cs
- MatrixTransform3D.cs
- GenericParameterDataContract.cs
- recordstatefactory.cs
- RequestCacheEntry.cs
- DataGridViewColumn.cs
- DocumentViewerBase.cs
- UTF8Encoding.cs
- NetworkInformationException.cs
- WindowsGraphics2.cs
- DataListDesigner.cs
- DataGridViewCellLinkedList.cs
- XsltArgumentList.cs
- WebSysDefaultValueAttribute.cs
- LinkConverter.cs
- RealizationDrawingContextWalker.cs
- HWStack.cs
- TreeNodeCollection.cs
- SubtreeProcessor.cs
- AsyncDataRequest.cs
- StructureChangedEventArgs.cs
- ModelItemCollection.cs
- MessageContractExporter.cs
- ListViewItemEventArgs.cs
- SqlCacheDependency.cs
- ToolStripLabel.cs
- AssemblyBuilderData.cs
- FormViewInsertEventArgs.cs
- RegexRunnerFactory.cs
- Setter.cs
- DPTypeDescriptorContext.cs
- ExpressionLexer.cs
- UserPreferenceChangingEventArgs.cs
- TextElementEnumerator.cs
- COM2IDispatchConverter.cs
- QueryGeneratorBase.cs
- Bitmap.cs
- EdmValidator.cs
- SqlMethodTransformer.cs
- SqlWebEventProvider.cs
- InkPresenterAutomationPeer.cs
- TypeBrowserDialog.cs
- NullableIntAverageAggregationOperator.cs
- Pts.cs
- Vector3DCollection.cs
- TextSearch.cs
- Compiler.cs
- FunctionDescription.cs
- DataReaderContainer.cs
- TextServicesCompartment.cs
- ContentValidator.cs
- CodeTypeReferenceExpression.cs
- CacheHelper.cs
- MenuItemStyleCollection.cs
- ScriptReference.cs
- OdbcConnection.cs
- WebPartRestoreVerb.cs
- ConfigXmlComment.cs
- Point3DKeyFrameCollection.cs
- Transform3DGroup.cs
- AsyncInvokeOperation.cs
- HttpCachePolicy.cs
- TimerElapsedEvenArgs.cs
- DataServiceProcessingPipelineEventArgs.cs
- ObjectToken.cs
- OleDbInfoMessageEvent.cs
- EncryptedPackageFilter.cs
- mediaeventargs.cs
- XamlPoint3DCollectionSerializer.cs
- StandardBindingCollectionElement.cs
- StackSpiller.Temps.cs
- InputLanguage.cs
- DependencyProperty.cs
- KnownTypesProvider.cs
- UndirectedGraph.cs
- CustomErrorCollection.cs
- WarningException.cs
- SqlCrossApplyToCrossJoin.cs
- FontFaceLayoutInfo.cs
- EditingCoordinator.cs
- PriorityRange.cs
- WebPartHeaderCloseVerb.cs
- TreeNodeEventArgs.cs
- Blend.cs
- BinaryObjectInfo.cs
- ZoneIdentityPermission.cs
- odbcmetadatafactory.cs
- ObjectList.cs
- XmlSchemaFacet.cs
- HandleCollector.cs
- DefaultValueAttribute.cs
- ChangePassword.cs