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
- WebPartDisplayModeCollection.cs
- WebPartTransformer.cs
- SimpleFieldTemplateUserControl.cs
- TextBlock.cs
- InternalPolicyElement.cs
- activationcontext.cs
- WmfPlaceableFileHeader.cs
- ContextStaticAttribute.cs
- ChannelCredentials.cs
- MsmqIntegrationBinding.cs
- TrackBarRenderer.cs
- ConfigurationManagerInternalFactory.cs
- EncryptedPackage.cs
- TemplatedWizardStep.cs
- ConfigurationHelpers.cs
- TableCellCollection.cs
- HtmlPageAdapter.cs
- ExclusiveNamedPipeTransportManager.cs
- SmtpFailedRecipientException.cs
- DesignerView.xaml.cs
- metadatamappinghashervisitor.cs
- UnsafeNativeMethodsCLR.cs
- DataListItem.cs
- RangeValuePattern.cs
- MetadataSerializer.cs
- JsonObjectDataContract.cs
- PropertyExpression.cs
- TextBounds.cs
- DbReferenceCollection.cs
- BinaryKeyIdentifierClause.cs
- manifestimages.cs
- LocatorManager.cs
- ComponentDispatcher.cs
- VectorAnimationBase.cs
- TargetException.cs
- ComponentConverter.cs
- TemplatedWizardStep.cs
- FixedElement.cs
- Bits.cs
- SHA512Managed.cs
- SecurityTokenAuthenticator.cs
- ConfigurationValidatorBase.cs
- IApplicationTrustManager.cs
- MeshGeometry3D.cs
- ForwardPositionQuery.cs
- FullTrustAssembly.cs
- HtmlTitle.cs
- BamlResourceDeserializer.cs
- DeviceSpecificChoice.cs
- HostSecurityManager.cs
- _BufferOffsetSize.cs
- TypedTableBaseExtensions.cs
- TransformationRules.cs
- RectConverter.cs
- MediaTimeline.cs
- HtmlTitle.cs
- ScriptReferenceBase.cs
- SqlUDTStorage.cs
- VarRefManager.cs
- IdentityValidationException.cs
- StyleCollectionEditor.cs
- MaskDescriptors.cs
- BitmapEffectGroup.cs
- TextEncodedRawTextWriter.cs
- XmlException.cs
- propertyentry.cs
- CapabilitiesUse.cs
- MessageQueuePermissionEntryCollection.cs
- XmlSchemaProviderAttribute.cs
- BackStopAuthenticationModule.cs
- CheckedListBox.cs
- FocusTracker.cs
- CodeTypeReferenceExpression.cs
- DataControlField.cs
- TemplateColumn.cs
- FreezableOperations.cs
- Win32KeyboardDevice.cs
- MessageQueueCriteria.cs
- EventLogPermission.cs
- Event.cs
- RemotingConfiguration.cs
- TabPage.cs
- DataControlPagerLinkButton.cs
- EventMappingSettings.cs
- HideDisabledControlAdapter.cs
- AttributeCollection.cs
- WsatTransactionFormatter.cs
- SkewTransform.cs
- DeclarativeCatalogPart.cs
- sqlpipe.cs
- StackSpiller.Temps.cs
- LexicalChunk.cs
- FixedPageProcessor.cs
- DbCommandDefinition.cs
- BuildManagerHost.cs
- KeysConverter.cs
- TextRunProperties.cs
- ExpressionCopier.cs
- DatatypeImplementation.cs
- XmlSerializableWriter.cs