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
- SoapExtensionStream.cs
- CompilerError.cs
- EnumUnknown.cs
- TaskSchedulerException.cs
- GlyphRunDrawing.cs
- TemplateColumn.cs
- SchemaRegistration.cs
- Module.cs
- RoleServiceManager.cs
- CompilationUtil.cs
- StringSorter.cs
- ValidationSummary.cs
- MimePart.cs
- COSERVERINFO.cs
- DocumentPageTextView.cs
- FileNameEditor.cs
- ClientRolePrincipal.cs
- DataGridViewBindingCompleteEventArgs.cs
- FamilyTypefaceCollection.cs
- TransactionContextValidator.cs
- OperationInvokerBehavior.cs
- Atom10FormatterFactory.cs
- CollectionBase.cs
- EntityCommandDefinition.cs
- XmlIterators.cs
- NotCondition.cs
- UseLicense.cs
- Menu.cs
- PermissionSetEnumerator.cs
- ColorMap.cs
- DataGridViewTopRowAccessibleObject.cs
- IChannel.cs
- SQLDoubleStorage.cs
- FormViewPageEventArgs.cs
- Models.cs
- DescendentsWalker.cs
- CompoundFileStreamReference.cs
- ProfileInfo.cs
- StylusEventArgs.cs
- SingleKeyFrameCollection.cs
- SecurityCriticalDataForSet.cs
- ToolStripOverflowButton.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DataIdProcessor.cs
- RectangleGeometry.cs
- Point3D.cs
- DefaultTraceListener.cs
- GeneralTransform.cs
- EventProviderClassic.cs
- TableLayoutCellPaintEventArgs.cs
- WmiEventSink.cs
- GenericsInstances.cs
- GradientBrush.cs
- Misc.cs
- DirectoryInfo.cs
- TemplatePropertyEntry.cs
- DeobfuscatingStream.cs
- SubMenuStyle.cs
- NavigationPropertyEmitter.cs
- SecurityDocument.cs
- TranslateTransform.cs
- PriorityBinding.cs
- MenuItemAutomationPeer.cs
- GridViewRowCollection.cs
- SqlAliasesReferenced.cs
- DBDataPermission.cs
- Encoder.cs
- FileSecurity.cs
- ObjectAssociationEndMapping.cs
- Mappings.cs
- CallInfo.cs
- ExtractedStateEntry.cs
- ButtonBase.cs
- XsltException.cs
- BamlRecordReader.cs
- WindowsSolidBrush.cs
- GraphicsPath.cs
- CDSCollectionETWBCLProvider.cs
- XmlCustomFormatter.cs
- AlignmentXValidation.cs
- XmlSchemaElement.cs
- SimpleWorkerRequest.cs
- SizeFConverter.cs
- Normalization.cs
- HMACSHA1.cs
- HttpHeaderCollection.cs
- XPathException.cs
- PropertyIdentifier.cs
- ExtensionCollection.cs
- ExpressionBuilder.cs
- NavigationProperty.cs
- ListViewSortEventArgs.cs
- Cursor.cs
- WmlCalendarAdapter.cs
- HandlerBase.cs
- TcpClientSocketManager.cs
- XMLSyntaxException.cs
- DiscoveryService.cs
- PingReply.cs
- SqlClientWrapperSmiStreamChars.cs