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
- ShaderRenderModeValidation.cs
- ButtonBase.cs
- StorageBasedPackageProperties.cs
- MetadataItemSerializer.cs
- CollectionConverter.cs
- IISUnsafeMethods.cs
- ReadOnlyTernaryTree.cs
- XpsFont.cs
- RelationshipConstraintValidator.cs
- DataViewSettingCollection.cs
- LingerOption.cs
- AuthStoreRoleProvider.cs
- StatusBarPanelClickEvent.cs
- RowVisual.cs
- SqlCacheDependencyDatabaseCollection.cs
- TranslateTransform3D.cs
- OrderByLifter.cs
- SspiWrapper.cs
- PeerNameRegistration.cs
- CommonDialog.cs
- TreeBuilder.cs
- LinkLabel.cs
- EnumerableCollectionView.cs
- _NetRes.cs
- Pointer.cs
- LocalizabilityAttribute.cs
- InstanceKeyCompleteException.cs
- SrgsElementFactoryCompiler.cs
- SpinLock.cs
- ProcessThread.cs
- GenericAuthenticationEventArgs.cs
- AuthenticationModulesSection.cs
- TypeDescriptionProvider.cs
- XXXInfos.cs
- CommandExpr.cs
- DataTableMappingCollection.cs
- EnumValAlphaComparer.cs
- Interlocked.cs
- CounterNameConverter.cs
- TdsValueSetter.cs
- XmlSchemaInclude.cs
- ConnectionConsumerAttribute.cs
- LocalizedNameDescriptionPair.cs
- UserControlBuildProvider.cs
- DataReaderContainer.cs
- WebEventTraceProvider.cs
- BaseValidator.cs
- ArgumentException.cs
- FixedMaxHeap.cs
- CodeComment.cs
- BuilderPropertyEntry.cs
- DateTimeConstantAttribute.cs
- EnumMember.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- DbProviderConfigurationHandler.cs
- MultiPropertyDescriptorGridEntry.cs
- WMIInterop.cs
- DocumentsTrace.cs
- RadialGradientBrush.cs
- LayoutInformation.cs
- securitycriticaldataformultiplegetandset.cs
- DataServiceEntityAttribute.cs
- EventsTab.cs
- RemotingConfigParser.cs
- SessionPageStatePersister.cs
- HeaderedItemsControl.cs
- WmfPlaceableFileHeader.cs
- NumberSubstitution.cs
- SimpleWorkerRequest.cs
- AssociationTypeEmitter.cs
- CodeGroup.cs
- DecimalStorage.cs
- RemoteWebConfigurationHostServer.cs
- NullableBoolConverter.cs
- baseaxisquery.cs
- InternalControlCollection.cs
- ColumnMapProcessor.cs
- InsufficientExecutionStackException.cs
- PartialArray.cs
- QueueException.cs
- Misc.cs
- StrokeNodeOperations.cs
- FixedFindEngine.cs
- PageContentAsyncResult.cs
- UserPreferenceChangedEventArgs.cs
- Nodes.cs
- GroupLabel.cs
- DataGridCell.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- WindowInteropHelper.cs
- NullableConverter.cs
- ColumnHeaderConverter.cs
- WriteTimeStream.cs
- ProjectedSlot.cs
- WebPartZoneBase.cs
- DataStorage.cs
- XmlNavigatorStack.cs
- RealProxy.cs
- AuthenticationException.cs
- Cursors.cs