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
- mda.cs
- COM2TypeInfoProcessor.cs
- XpsFilter.cs
- HtmlShimManager.cs
- securestring.cs
- MimeMapping.cs
- CurrentTimeZone.cs
- RedirectionProxy.cs
- ToolStripDropDownClosingEventArgs.cs
- DataKey.cs
- ResourceKey.cs
- HashMembershipCondition.cs
- UrlPath.cs
- IdentityNotMappedException.cs
- WebBrowsableAttribute.cs
- Propagator.cs
- PageTheme.cs
- HybridDictionary.cs
- PrintPreviewControl.cs
- TextTreeTextNode.cs
- GridViewUpdatedEventArgs.cs
- CaseDesigner.xaml.cs
- HtmlInputFile.cs
- ToolStripSplitStackLayout.cs
- CroppedBitmap.cs
- ReferentialConstraint.cs
- XmlSortKey.cs
- DesignerVerb.cs
- ClientTarget.cs
- BaseCodePageEncoding.cs
- PerformanceCounterPermission.cs
- TemplatingOptionsDialog.cs
- DataGridViewCellStyleConverter.cs
- UrlMappingsModule.cs
- CodeTypeConstructor.cs
- WebPartConnectionsCloseVerb.cs
- View.cs
- ObjectSet.cs
- QueryCacheKey.cs
- InstallerTypeAttribute.cs
- WsatRegistrationHeader.cs
- CommonObjectSecurity.cs
- TheQuery.cs
- XmlNamespaceManager.cs
- URLString.cs
- ParameterReplacerVisitor.cs
- IdentityNotMappedException.cs
- LinkUtilities.cs
- Typeface.cs
- XmlUrlResolver.cs
- NameSpaceExtractor.cs
- RowToParametersTransformer.cs
- StateInitializationDesigner.cs
- XmlStreamNodeWriter.cs
- VarRefManager.cs
- CheckBoxFlatAdapter.cs
- FieldDescriptor.cs
- URLMembershipCondition.cs
- DictionaryEditChange.cs
- LiteralControl.cs
- ShapeTypeface.cs
- infer.cs
- AssociationSet.cs
- LiteralDesigner.cs
- CroppedBitmap.cs
- WebContext.cs
- Int64Converter.cs
- MemberExpression.cs
- Transform.cs
- FloaterBaseParaClient.cs
- SqlInfoMessageEvent.cs
- Scalars.cs
- XamlBrushSerializer.cs
- MessageTransmitTraceRecord.cs
- DispatcherFrame.cs
- CachedCompositeFamily.cs
- TransformGroup.cs
- VideoDrawing.cs
- DropShadowBitmapEffect.cs
- XmlSerializerFaultFormatter.cs
- RemoteWebConfigurationHostStream.cs
- FixedSOMTableRow.cs
- DefaultBindingPropertyAttribute.cs
- TextTreeUndo.cs
- NavigationProperty.cs
- XmlNamedNodeMap.cs
- SimpleType.cs
- XpsS0ValidatingLoader.cs
- ScrollContentPresenter.cs
- CancellationHandler.cs
- SHA256Managed.cs
- InitializerFacet.cs
- PointAnimationBase.cs
- MethodBuilderInstantiation.cs
- SQLDateTime.cs
- UriParserTemplates.cs
- EnterpriseServicesHelper.cs
- ConfigurationSectionGroupCollection.cs
- DecimalConverter.cs
- XpsImage.cs