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
- FunctionDefinition.cs
- RegexWorker.cs
- ProtocolsConfigurationEntry.cs
- RadioButtonAutomationPeer.cs
- JoinTreeNode.cs
- ConfigXmlDocument.cs
- DateBoldEvent.cs
- CurrentChangedEventManager.cs
- XD.cs
- EasingQuaternionKeyFrame.cs
- FormsAuthentication.cs
- SqlClientPermission.cs
- ToolStripDropDownMenu.cs
- KoreanLunisolarCalendar.cs
- FileAuthorizationModule.cs
- BamlBinaryReader.cs
- InternalResources.cs
- CodeBlockBuilder.cs
- AvtEvent.cs
- XLinq.cs
- NamespaceExpr.cs
- DataGridTableCollection.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- shaper.cs
- ListViewTableCell.cs
- BitmapEffectState.cs
- UrlAuthFailedErrorFormatter.cs
- BypassElement.cs
- cookiecontainer.cs
- ImageBrush.cs
- ListViewGroupItemCollection.cs
- BoundingRectTracker.cs
- ItemCollection.cs
- OperationInfo.cs
- CellNormalizer.cs
- XmlTextReader.cs
- ContainerUIElement3D.cs
- AppDomainAttributes.cs
- DataGridViewCellStyleConverter.cs
- MenuItem.cs
- ValuePatternIdentifiers.cs
- PartialList.cs
- ObjectTypeMapping.cs
- ReadOnlyHierarchicalDataSource.cs
- ZipIOLocalFileDataDescriptor.cs
- recordstatescratchpad.cs
- RegexCompilationInfo.cs
- WithStatement.cs
- DynamicControl.cs
- XmlDataCollection.cs
- AesManaged.cs
- CheckBoxList.cs
- ActiveXHelper.cs
- SchemaSetCompiler.cs
- RowUpdatingEventArgs.cs
- WebPartZoneBase.cs
- TempEnvironment.cs
- MobileListItemCollection.cs
- DateTimeConverter.cs
- TypeReference.cs
- QilUnary.cs
- DeflateInput.cs
- SecurityUtils.cs
- SafeThemeHandle.cs
- MatrixUtil.cs
- IpcManager.cs
- _SingleItemRequestCache.cs
- PolicyManager.cs
- BindToObject.cs
- RandomDelayQueuedSendsAsyncResult.cs
- InvalidEnumArgumentException.cs
- Update.cs
- newinstructionaction.cs
- PagesSection.cs
- SqlDependency.cs
- DataGridViewCellMouseEventArgs.cs
- TextEditorCopyPaste.cs
- ObjectSet.cs
- CompoundFileDeflateTransform.cs
- ETagAttribute.cs
- IsolatedStoragePermission.cs
- SubtreeProcessor.cs
- ExpandedWrapper.cs
- EdmRelationshipRoleAttribute.cs
- CellLabel.cs
- CodeIdentifiers.cs
- OuterGlowBitmapEffect.cs
- StringWriter.cs
- ValidationSummary.cs
- RayHitTestParameters.cs
- PeerCollaboration.cs
- DataGridColumnFloatingHeader.cs
- SqlCacheDependency.cs
- PageBorderless.cs
- UnhandledExceptionEventArgs.cs
- ConnectionStringsSection.cs
- WebPartZoneBase.cs
- BrowserInteropHelper.cs
- FixedSOMFixedBlock.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs